porting linux 2.6.27 to embedded powerpc board
Hi, I have an embedded PowerPC (MPC8347) board that works fine with uboot and Linux 2.6.15. I am trying to upgrade the kernel so that it runs on the latest release - Linux 2.6.27. So far, I have gotten the kernel to compile on my platform, but of course it does not boot. Things have changed drastically since 2.6.15 and the porting methodology used back then is obsolete now. Progress is a good thing :-) I have googled for info on how to accomplish this port but have found nothing so far. In particular, the fact that I am using uboot instead of open firmware makes the task a bit more daunting. The file Documentation/powerpc/booting-without-of.txt gives some info on the flattened device tree and and at the end of the "board support" section it states "I will describe later the boot process and various callbacks that your platform should implement." but that description is not part of the document. I am wondering where I can find more info that will help me accomplish this port. thanks a lot for your help. L.K ___ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Re: porting linux 2.6.27 to embedded powerpc board
Just wanted to thank all of you for the detailed feedback and suggestions. I am going to try them out now and keep my fingers crossed. thanks again LK - Original Message From: Scott Wood <[EMAIL PROTECTED]> To: David Jander <[EMAIL PROTECTED]> Cc: linuxppc-embedded@ozlabs.org; Laxmikant Rashinkar <[EMAIL PROTECTED]> Sent: Thursday, August 21, 2008 9:12:23 AM Subject: Re: porting linux 2.6.27 to embedded powerpc board David Jander wrote: > 4. Be sure that the device(s) necessary to produce output on your console are > correctly placed in the DT. Also make sure that u-boot knows about it > (#define OF_STDOUT_PATH... in your u-boot board config file) OF_STDOUT_PATH is deprecated; you should enable CONFIG_OF_SERIAL_VIA_ALIAS, and provide aliases in the device tree for serial0, serial1, etc. > 6. Remember to always specify the "rootfstype=" option on the commandline if > booting from anything other than NFS. This was not necessary back in the > 2.6.15-times AFAICR. It still should not be necessary. > 7. Boot with a device-tree (in u-boot: "bootm $addrofkernel - $addrofdtb", > don't forget the dash if you are not using an initrd). If you don't do this, > u-boot can't fix your DT, and the kernel probably won't find it either. s/probably/definitely/ > 8. Be sure to use the correct version of the DTC (DT compiler) for your > kernel > (the sources are included nowadays, somewhere in arch/powerpc/boot IIRC). The > command used to compile, should probably be something like this: Or just use the most recent DTC. -Scott ___ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Re: porting linux 2.6.27 to embedded powerpc board
Hi, I still haven't gotten anything to work :-( I'm using Uboot 1.1.4 and Linux 2.6.27 but instead of using uImage, I'm using cuImage. The args to dtc are as listed by David Jander My cmd line args are: setenv bootargs root=/dev/ram0 init=/rescue rw console=ttyS0,9600 ramdisk_size=65536 When I attempt to boot my image it just hangs w/o any output. I dearly wish I could get some console output. Here is the actual display from uboot: ## Booting image at 0080 ... Image Name: Linux-2.6.27-rc2 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size:1640425 Bytes = 1.6 MB Load Address: 0040 Entry Point: 0040055c Verifying Checksum ... OK Uncompressing Kernel Image ... OK ## Loading RAMDisk Image at 0100 ... Image Name: flash_root.ext3.gz Image Type: PowerPC Linux RAMDisk Image (gzip compressed) Data Size:13450106 Bytes = 12.8 MB Load Address: Entry Point: Verifying Checksum ... OK Loading Ramdisk to 0f29d000, end 0ff70b7a ... OK Two questions: 1) the load address and entry point for the kernel (see above) are non-zero. When we load via uImage, they are always zero. Is this normal? dtc has not options to set the load address and entry point. 2) When I build my kernel, I get two warnings. Could these be causing a problem? WARNING: mm/built-in.o(.data+0x8ec): Section mismatch in reference from the variable contig_page_data to the variable .init.data:bootmem_node_data The variable contig_page_data references the variable __initdata bootmem_node_data If the reference is valid then annotate the variable with __init* (see linux/init.h) or name the variable: *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, MODPOST vmlinux.o WARNING: vmlinux.o(.data+0xfe74): Section mismatch in reference from the variable contig_page_data to the variable .init.data:bootmem_node_data The variable contig_page_data references the variable __initdata bootmem_node_data If the reference is valid then annotate the variable with __init* (see linux/init.h) or name the variable: *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, thanks so much for your help. LK - Original Message From: David Jander <[EMAIL PROTECTED]> To: linuxppc-embedded@ozlabs.org Cc: Laxmikant Rashinkar <[EMAIL PROTECTED]> Sent: Thursday, August 21, 2008 2:43:45 AM Subject: Re: porting linux 2.6.27 to embedded powerpc board On Thursday 21 August 2008 01:24:46 Laxmikant Rashinkar wrote: > Hi, > > I have an embedded PowerPC (MPC8347) board that works fine with uboot and > Linux 2.6.15. > > I am trying to upgrade the kernel so that it runs on the latest release - > Linux 2.6.27. So far, I have gotten the kernel to compile on my platform, > but of course it does not boot. Well, honestly I don't know where to look for information either (other than the source-code and examples from others), but here is a list with points to look out for (I have just done the same thing as you for a MPC5200B-based board): 1. Upgrade to latest u-boot first (recent git seems to be fine). There have been a lot of changes in u-boot lately about OF and device-tree related things. I suspect you need a fairly recent version of u-boot to go well with the latest kernel. It's also generally a good idea IMHO. 2. I assume you are porting to arch/powerpc (the old arch/ppc you used back in 2.6.15 is obsolete and broken now). 3. Look at other platforms that use the same processor, and pick a simple one as starting point. Look out for the dts (device-tree-source file in arch/powerpc/boot/dts), copy and modify one to reflect your hardware. Recently a lot of changes happend in the kernel, changing device names, obsoleting "device-type" tags, etc..., so some of the current DTS sources included in the kernel might not even work (wrong device name, missing information, wrong use of "device-type", etc...), so watch out for these kind of issues too. 4. Be sure that the device(s) necessary to produce output on your console are correctly placed in the DT. Also make sure that u-boot knows about it (#define OF_STDOUT_PATH... in your u-boot board config file) 5. When compiling the device tree, it may be necessary to add some extra reserved entries to the compiled tree (I am using dtc -p 10240 -R 20, which might be slightly exaggerated), because u-boot may add something to it, and if it can't, linux won't boot. 6. Remember to always specify the "rootfstype=" option on the commandline if booting from anything other than NFS. This was not necessary back in the 2.6.15-times AFAICR. 7. Boot with a device-tree (in u-boot: "bootm $addrofkernel - $addrofdtb", don't forget the dash if you are not using an initrd). If you don't do this, u-boot can't fix your DT, and the kernel probably wo
Re: porting linux 2.6.27 to embedded powerpc board
Hi, I now have the system booted all the up to the shell prompt. However, my two NIC cards are not up. When the system is booting, I get the following error: TCP cubic registered NET: Registered protocol family 17 RPC: Registered udp transport module. RPC: Registered tcp transport module. 24520:00 not found eth0: Could not attach to PHY IP-Config: Failed to open eth0 IP-Config: Device `eth0' not found. here is the networking section from my .dts file [EMAIL PROTECTED] { #address-cells = <1>; #size-cells = <0>; compatible = "fsl,gianfar-mdio"; reg = <0x24520 0x20>; phy0: [EMAIL PROTECTED] { interrupt-parent = <&ipic>; interrupts = <17 0x8>; reg = <0x0>; device_type = "ethernet-phy"; }; phy1: [EMAIL PROTECTED] { interrupt-parent = <&ipic>; interrupts = <18 0x8>; reg = <0x1>; device_type = "ethernet-phy"; }; }; enet0: [EMAIL PROTECTED] { cell-index = <0>; device_type = "network"; model = "TSEC"; compatible = "gianfar"; reg = <0x24000 0x1000>; local-mac-address = [ 00 00 00 00 00 00 ]; interrupts = <32 0x8 33 0x8 34 0x8>; interrupt-parent = <&ipic>; phy-handle = <&phy0>; linux,network-index = <0>; }; enet1: [EMAIL PROTECTED] { cell-index = <1>; device_type = "network"; model = "TSEC"; compatible = "gianfar"; reg = <0x25000 0x1000>; local-mac-address = [ 00 00 00 00 00 00 ]; interrupts = <35 0x8 36 0x8 37 0x8>; interrupt-parent = <&ipic>; phy-handle = <&phy1>; linux,network-index = <1>; }; Does anything here seem to be wrong? thanks for your help LK - Original Message From: David Jander <[EMAIL PROTECTED]> To: linuxppc-embedded@ozlabs.org Cc: Laxmikant Rashinkar <[EMAIL PROTECTED]> Sent: Thursday, August 21, 2008 2:43:45 AM Subject: Re: porting linux 2.6.27 to embedded powerpc board On Thursday 21 August 2008 01:24:46 Laxmikant Rashinkar wrote: > Hi, > > I have an embedded PowerPC (MPC8347) board that works fine with uboot and > Linux 2.6.15. > > I am trying to upgrade the kernel so that it runs on the latest release - > Linux 2.6.27. So far, I have gotten the kernel to compile on my platform, > but of course it does not boot. Well, honestly I don't know where to look for information either (other than the source-code and examples from others), but here is a list with points to look out for (I have just done the same thing as you for a MPC5200B-based board): 1. Upgrade to latest u-boot first (recent git seems to be fine). There have been a lot of changes in u-boot lately about OF and device-tree related things. I suspect you need a fairly recent version of u-boot to go well with the latest kernel. It's also generally a good idea IMHO. 2. I assume you are porting to arch/powerpc (the old arch/ppc you used back in 2.6.15 is obsolete and broken now). 3. Look at other platforms that use the same processor, and pick a simple one as starting point. Look out for the dts (device-tree-source file in arch/powerpc/boot/dts), copy and modify one to reflect your hardware. Recently a lot of changes happend in the kernel, changing device names, obsoleting "device-type" tags, etc..., so some of the current DTS sources included in the kernel might not even work (wrong device name, missing information, wrong use of "device-type", etc...), so watch out for these kind of issues too. 4. Be sure that the device(s) necessary to produce output on your console are correctly placed in the DT. Also make sure that u-boot knows about it (#define OF_STDOUT_PATH... in your u-boot board config file) 5. When compiling the device tree, it may be necessary to add some extra reserved entries to the compiled tree (I am using dtc -p 10240 -R 20, which might be slightly exaggerated),
How to access Freesale UPM NAND device
Hi, quick question: I have a custom board running MPC8347 on Linux 2.6.27 with Uboot 1.1.4. I also have a NAND device (Micron MT29F2G08AACWP) connected to the LBC and controlled via UPM. fsl_elbc_nand.ko, fsl_upm.ko are loaded. I'm wondering how to access the NAND device. Do I need mDOC? TrueFFS? I have grep'd for the functions declared in fsl_upm.c and fsl_lbc.c and find that no other code path calls these functions. So it looks like the drivers are loaded but no one calls into them. any help appreciated. thanks LK ___ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Re: Compile new kernel for 5200B w/ ELDK
I had the same problem as you. For what its worth, here is what I added to the end of my .dts file to get my console working for a MPC8347 embedded systems chosen { linux,stdout-path = &serial0; }; Also, since I use uboot and not OF, I load the cuImage file instead of the uImage file thanks LK - Original Message From: Albrecht Dreà <[EMAIL PROTECTED]> To: linuxppc-embedded@ozlabs.org Sent: Tuesday, September 2, 2008 10:18:15 AM Subject: Re: Compile new kernel for 5200B w/ ELDK Hi Detlev: Am 01.09.08 16:42 schrieb(en) Detlev Zundel: > Use a recent kernel version. 2.6.26 should work out of the box > without too much hassle. Some of the older versions had problems > effectively stalling Linux very early without any output on the > console. Thanks a lot for your hint, but unfortunately it doesn't solve my problem: - downloaded 2.6.26.3 from kernel.org; - called "make ARCH=powerpc CROSS_COMPILE=ppc_6xx- 52xx/lite5200b_defconfig"; - called "make ARCH=powerpc CROSS_COMPILE=ppc_6xx- uImage". However, even with "console=ttyPSC0,115200 verbose panic=1" in the bootargs, the kernel simply doesn't say /anything/ after decompression: => bootm ## Booting kernel from Legacy Image at 0100 ... Image Name: Linux-2.6.26.3 Created: 2008-09-02 9:11:12 UTC Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size:1341904 Bytes = 1.3 MB Load Address: Entry Point: Verifying Checksum ... OK Uncompressing Kernel Image ... OK Do I understand the remark in Documentation/powerpc/booting-without-of.txt, section "The /chosen node", correctly that it is *not* necessary to add it to the dts file as u-boot 1.3.4 should fill it in automatically? Anyway, adding this section doesn't change anything... HELP! I'm really lost here... Thanks, Albrecht. ___ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded
UPM setup
Hi, I'm trying to set up the UPM RAM table for NAND access. Here is how I do it: char __iomem *lbc_addr; int i; lbc_addr = ioremap(0xa000, 0x10); /* NAND chip (256MB) will be driven by UPM-A at LBC address 0xa000 */ out_be32(&fsl_lbc_regs->bank[4].br, 0xa881); out_be32(&fsl_lbc_regs->bank[4].or, 0xf001); /* setup MAMR for sequential write to UPM-A RAM */ out_be32(&fsl_lbc_regs->mamr, 0x1000); for (i = 0; i < 64; i++) { out_be32(&fsl_lbc_regs->mdr, UPMATable[i]); out_8(lbc_addr, 0); /* dummy write, byte wide */ } /* restore MAMR */ out_be32(&fsl_lbc_regs->mamr, 0x); But this does not seem to be working. I have verified this in two ways a) for each write to mdr in the for loop above, I read back mamr and print it. This should have an incrementing MAD value, but it does not b) I read back the data that I had stored in UPM-A RAM and that logic does not work either. My take is that out_8(lbc_addr, 0) is not working because I'm not mapping lbc_addr correctly. Can someone tell me what I'm doing wrong? thanks for your help LK ___ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded
cuImage not building
Hi, I have gotten our MPC8347 based board to work under Linux-2.6.27.1. Since our board is similar to mpc834x_mds, I initially modified files relevant to mpc834x_mds to get our board working. Now I'm trying to rename files so that they reflect our board names. After this renaming, uImage gets built ok, but cuImage build fails. I enabled make's verbose flag to see what was going on and here are the error messages + powerpc-unknown-linux-gnu-ld -m elf32ppc -T arch/powerpc/boot/zImage.lds -Ttext 0x40 --defsym _start=0x40 -o arch/ppc/boot/cuImage.snsp arch/powerpc/boot/cuboot-snsp.o ./zImage.15886.o arch/powerpc/boot/wrapper.a powerpc-unknown-linux-gnu-ld: arch/powerpc/boot/cuboot-snsp.o: No such file: No such file or directory Here is the build invocation with mpc834x_mds files. + powerpc-unknown-linux-gnu-ld -m elf32ppc -T arch/powerpc/boot/zImage.lds -Ttext 0x40 --defsym _start=0x40 -o arch/ppc/boot/cuImage.mpc834x_mds arch/powerpc/boot/cuboot-83xx.o ./zImage.3158.o arch/powerpc/boot/wrapper.a >From the two invocations, not working code gets called with >arch/powerpc/boot/cuboot-snsp.o whereas working code gets called with arch/powerpc/boot/cuboot-83xx.o. I have made relevant changes to appropriate Makefiles, but I still cant get cuImage to build. can someone help? thanks a lot LK ___ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Re: cuImage not building
Thanks a lot Grant. With your pointers I was able to fix the problem. LK From: Grant Likely <[EMAIL PROTECTED]> To: Laxmikant Rashinkar <[EMAIL PROTECTED]> Cc: linuxppc-embedded@ozlabs.org Sent: Thursday, October 23, 2008 7:26:42 PM Subject: Re: cuImage not building On Thu, Oct 23, 2008 at 07:05:20PM -0700, Laxmikant Rashinkar wrote: > Hi, > > I have gotten our MPC8347 based board to work under Linux-2.6.27.1. > > Since our board is similar to mpc834x_mds, I initially modified files relevant > to mpc834x_mds to get our board working. > > Now I'm trying to rename files so that they reflect our board names. > > After this renaming, uImage gets built ok, but cuImage build fails. > I enabled make's verbose flag to see what was going on > and here are the error messages > > + powerpc-unknown-linux-gnu-ld -m elf32ppc -T arch/powerpc/boot/zImage.lds > -Ttext 0x40 --defsym _start=0x40 -o arch/ppc/boot/cuImage.snsp > arch/powerpc/boot/cuboot-snsp.o ./zImage.15886.o arch/powerpc/boot/wrapper.a > powerpc-unknown-linux-gnu-ld: arch/powerpc/boot/cuboot-snsp.o: No such file: > No such file or directory > > Here is the build invocation with mpc834x_mds files. > > + powerpc-unknown-linux-gnu-ld -m elf32ppc -T arch/powerpc/boot/zImage.lds > -Ttext 0x40 --defsym _start=0x40 -o arch/ppc/boot/cuImage.mpc834x_mds > arch/powerpc/boot/cuboot-83xx.o ./zImage.3158.o arch/powerpc/boot/wrapper.a > > From the two invocations, not working code gets called with > arch/powerpc/boot/cuboot-snsp.o > whereas working code gets called with arch/powerpc/boot/cuboot-83xx.o. > > I have made relevant changes to appropriate Makefiles, but I still cant get > cuImage to build. Look at Documentation/powerpc/bootwrapper.txt and arch/powerpc/boot/wrapper. There is some magic stuff in the wrapper script which translates board names into the correct wrapper bits. This is particularly important for cuboot targets. g. ___ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded ___ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded
i2c driver's probe routine not getting called
Hi, I have linux-2.6.27.1 running on a MPC8347 based board. When my freescale I2C driver is insmoded, it calls platform_driver_register() successfully, but the probe routine doesn't get called. AFAIK, this only happens if the device is not known. I could call platform_device_register() to make the device known, but it seems to be the wrong approach. Shouldn't the definitions in my device tree be doing that? Here is the i2c section of my device tree: [EMAIL PROTECTED] { #address-cells = <1>; #size-cells = <0>; cell-index = <0>; compatible = "fsl-i2c"; reg = <0x3000 0x100>; interrupts = <14 0x8>; interrupt-parent = <&ipic>; dfsrr; [EMAIL PROTECTED] { compatible = "dallas,ds1374"; reg = <0x68>; }; }; [EMAIL PROTECTED] { #address-cells = <1>; #size-cells = <0>; cell-index = <1>; compatible = "fsl-i2c"; reg = <0x3100 0x100>; interrupts = <15 0x8>; interrupt-parent = <&ipic>; dfsrr; }; Could something be wrong here? Note that the same drivers works fine under linux-2.6.15.4 all help appreciated thanks LK ___ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded
request_irq issue
Hi, I have a MPC8347 based board that runs linux-2.6.15.4 and 2.6.27.1. With the older Linux, my driver is able to successfully request_irq() interrupts 17, 18, 19, 20, 21, 22, 23 & 48. But with the newer linux, request_irq() works only for 17, 18 & 19. cat /proc/interrupts shows that none of the interrupts above are in use. Any pointers on why request_irq() is behaving thus? thanks for your help LK ___ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Re: i2c driver's probe routine not getting called
I actually tried using the in tree i2c-mpc driver before sending out my email. This driver would silently reset the system when i2c accesses took place. So I guess I'll try to modify the old driver to support new OF interface. thanks LK From: Scott Wood <[EMAIL PROTECTED]> To: Laxmikant Rashinkar <[EMAIL PROTECTED]> Cc: linuxppc-embedded@ozlabs.org Sent: Wednesday, November 5, 2008 8:15:17 AM Subject: Re: i2c driver's probe routine not getting called Laxmikant Rashinkar wrote: > I have linux-2.6.27.1 running on a MPC8347 based board. > > When my freescale I2C driver is insmoded, it calls platform_driver_register() > successfully, but the probe routine doesn't get called. Is "your" freescale I2C driver different from "the" freescale I2C driver in drivers/i2c/busses/i2c-mpc.c? If so, you'll need to update it to be an of_platform driver like the in-tree driver is (or, just switch to the in-tree driver). -Scott ___ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded