question about arch_initcall()
Hi all I would like to know how this macro is used, and when is called the function registered with it. thanks for all. Nathael PAJANI Ing?nieur CPE Lyon nathael.pajani at cpe.fr
Cross Compiling driver for PPC
Hi We are trying to port a newly developed device driver for powerPC . We are unable to compile it for powerpc driver on Host platform. Please give us the way to compile the device driver You need to cross compile, which means having a ggc for powerpc in addition to the gcc you have for your developpement machine. I do not know whether you will find it on the net, usualy you have to recompile gcc (and ld and ar and so on, the whole gcc toolchain I think) with specific options Then you will have a powerpc-linux-gcc (for example) which will be able to compile for powerpc then, you will have some modifications to do in the makefiles: look for this string: CROSS_COMPILE and set it to powerpc-linux- (or whatever is the prefix for you gcc). I also created a .arch file at the base of the source tree, containing ppc and some other modifications in makefiles, but I cannot tell you wich... and wether they are usefull. You'll have to try. Then add ARCH=ppc option to the make command when you want to compile your kernel for powerpc. Have fun. +++ Nathael PAJANI Ing?nieur CPE Lyon nathael.pajani at cpe.fr
porting linux on the prpmc610 and the mvme6100
hey: google is your friend: motorola.com MVME6100 linux patch https://mcg.motorola.com/cfm/templates/linux.cfm?PageID=705 Have fun once again :) +++ Nathael PAJANI Ing?nieur CPE Lyon nathael.pajani at cpe.fr
[PATCH] powerpc: CPM2 interrupt handler failure after 100,000
interrupts Message-Id: 20051219100059.5a95533f.nathael.pajani at cpe.fr X-Mailer: Sylpheed version 2.0.4 (GTK+ 2.8.9; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi! Hum.. in the patch you moved from void to int: -static void cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) +static int cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) But should'nt it be irqreturn_t ? static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs) +++ Have fun :) =20 Nathael PAJANI Ing=E9nieur CPE Lyon nathael.pajani at cpe.fr
Problem loading modules
Hi! I'm working with a ml403 board, porting Linux 2.4.devel on it. I got the OS running, but I cannot load modules. When I try modprobe /lib/modules/version/kernel/net/module.o, I obtain the error messages: Note: /etc/modules.conf is more recent than /lib/modules/version/modules.dep modprobe: Can't locate module lib/modules/version/kernel/net/module.o did you try with insmod ? then try running depmod. Nathael PAJANI Ing?nieur CPE Lyon nathael.pajani at cpe.fr
[PATCH] CPM initial console on ttyS instead of ttyCPM
Hi! here is a patch to have the CPM consoles on /dev/ttyS* instead of /dev/ttyCPM* Of course, it depends on not already having a 8250 like uart configured, in which case it falls back to ttyCPM. Signed-off-by: Nathael Pajani nathael.pajani at cpe.fr diff -urpN linux-2.6.13.2_light/drivers/serial/cpm_uart/cpm_uart_core.c ecrin-2.6.13.2_light/drivers/serial/cpm_uart/cpm_uart_core.c --- linux-2.6.13.2_light/drivers/serial/cpm_uart/cpm_uart_core.c 2005-12-16 12:08:48.867092000 +0100 +++ ecrin-2.6.13.2_light/drivers/serial/cpm_uart/cpm_uart_core.c 2005-12-16 11:53:13.140613000 +0100 @@ -70,10 +70,11 @@ static void cpm_uart_init_scc(struct uar static void cpm_uart_initbd(struct uart_cpm_port *pinfo); /**/ +/*cpm2_immr = (cpm2_map_t *)ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE)*/ static inline unsigned long cpu2cpm_addr(void *addr) { - if ((unsigned long)addr = CPM_ADDR) + if( (unsigned long)addr = CPM_ADDR ) return (unsigned long)addr; return virt_to_bus(addr); } @@ -1072,13 +1073,13 @@ static void cpm_uart_console_write(struc } /* - * Setup console. Be careful is called early ! + * Setup console. Be careful this is called early ! */ static int __init cpm_uart_console_setup(struct console *co, char *options) { struct uart_port *port; struct uart_cpm_port *pinfo; - int baud = 38400; + int baud = 9600;/* NATH: was 38400 */ int bits = 8; int parity = 'n'; int flow = 'n'; @@ -1136,7 +1137,11 @@ static int __init cpm_uart_console_setup static struct uart_driver cpm_reg; static struct console cpm_scc_uart_console = { +#ifndef CONFIG_SERIAL_8250 + .name = ttyS, +#else .name = ttyCPM, +#endif .write = cpm_uart_console_write, .device = uart_console_device, .setup = cpm_uart_console_setup, @@ -1163,8 +1168,14 @@ console_initcall(cpm_uart_console_init); static struct uart_driver cpm_reg = { .owner = THIS_MODULE, +#ifndef CONFIG_SERIAL_8250 + .driver_name= serial, +/* .devfs_name = tts/, */ + .dev_name = ttyS, +#else .driver_name= ttyCPM, .dev_name = ttyCPM, +#endif .major = SERIAL_CPM_MAJOR, .minor = SERIAL_CPM_MINOR, .cons = CPM_UART_CONSOLE, @@ -1174,7 +1185,7 @@ static int __init cpm_uart_init(void) { int ret, i; - printk(KERN_INFO Serial: CPM driver $Revision: 0.01 $\n); + printk(KERN_INFO Serial: CPM driver $Revision: 0.01b $\n); #ifndef CONFIG_SERIAL_CPM_CONSOLE ret = cpm_uart_init_portdesc(); diff -urpN linux-2.6.13.2_light/drivers/serial/cpm_uart/cpm_uart_cpm2.h ecrin-2.6.13.2_light/drivers/serial/cpm_uart/cpm_uart_cpm2.h --- linux-2.6.13.2_light/drivers/serial/cpm_uart/cpm_uart_cpm2.h 2005-12-16 12:08:48.883093000 +0100 +++ ecrin-2.6.13.2_light/drivers/serial/cpm_uart/cpm_uart_cpm2.h 2005-12-16 11:53:13.144613000 +0100 @@ -20,9 +20,6 @@ #define SCC3_IRQ SIU_INT_SCC3 #define SCC4_IRQ SIU_INT_SCC4 -/* the CPM address */ -#define CPM_ADDR CPM_MAP_ADDR - static inline void cpm_set_brg(int brg, int baud) { cpm_setbrg(brg, baud); diff -urpN linux-2.6.13.2_light/drivers/serial/cpm_uart/cpm_uart.h ecrin-2.6.13.2_light/drivers/serial/cpm_uart/cpm_uart.h --- linux-2.6.13.2_light/drivers/serial/cpm_uart/cpm_uart.h 2005-12-16 12:08:48.863092000 +0100 +++ ecrin-2.6.13.2_light/drivers/serial/cpm_uart/cpm_uart.h 2005-12-16 11:53:13.140613000 +0100 @@ -17,8 +17,13 @@ #include cpm_uart_cpm1.h #endif -#define SERIAL_CPM_MAJOR 204 -#define SERIAL_CPM_MINOR 46 +#ifndef CONFIG_SERIAL_8250 +#define SERIAL_CPM_MAJORTTY_MAJOR +#define SERIAL_CPM_MINOR64 +#else +#define SERIAL_CPM_MAJOR204 +#define SERIAL_CPM_MINOR46 +#endif #define IS_SMC(pinfo) (pinfo-flags FLAG_SMC) #define IS_DISCARDING(pinfo) (pinfo-flags FLAG_DISCARDING) diff -urpN linux-2.6.13.2_light/drivers/serial/cpm_uart/Makefile ecrin-2.6.13.2_light/drivers/serial/cpm_uart/Makefile --- linux-2.6.13.2_light/drivers/serial/cpm_uart/Makefile 2005-12-16 12:08:48.859091000 +0100 +++ ecrin-2.6.13.2_light/drivers/serial/cpm_uart/Makefile 2005-12-16 11:53:13.140613000 +0100 @@ -1,5 +1,5 @@ # -# Makefile for the Motorola 8xx FEC ethernet controller +# Makefile for the CPM ethernet controllers # obj-$(CONFIG_SERIAL_CPM) += cpm_uart.o Nathael PAJANI Ing?nieur CPE Lyon nathael.pajani at cpe.fr
no IRQ from USB on MPC8248
Hi all! As I said previously I started a backport of the hcd driver from sourceforge (http://cpm2usb.sourceforge.net/) to linux 2.6.9 for an actis board (VSBC6848) based on a MPC8248 (MPC8272 family) I have a running 2.6.9 kernel for this board, and no other, that's why I'm doing a backport of the driver. (for those who might wonder) I managed to have the core up: --- insmod usbcore.ko Using usbcore.ko usbcore: registered new driver usbfs usbcore: registered new driver hub --- mount /proc/bus/usb --- insmod m82xx-hcd.ko Using m82xx-hcd.ko = driver mpc82xx-hcd, 0.02 mpc82xx-hcd mpc82xx-hcd3: PQ2 intergrated USB controller v0.1 mpc82xx-hcd mpc82xx-hcd3: new USB bus registered, assigned bus number 1 hub 1-0:1.0: USB hub found hub 1-0:1.0: 1 port detected PQ2USB: debug file creation --- Done ~ # so this is OK then, when plugging a device, I got this: usb 1-1: new full speed USB device using address 2 usb 1-1: control timeout on ep0out mpc82xx-hcd mpc82xx-hcd3: Unlink after no-IRQ? Different ACPI or APIC settings may help. usb 1-1: control timeout on ep0out usb 1-1: device not accepting address 2, error -110 usb 1-1: new full speed USB device using address 3 usb 1-1: control timeout on ep0out usb 1-1: control timeout on ep0out usb 1-1: device not accepting address 3, error -110 which means the hub detects a device, and tries to configure it. On the device (MP3player) I have an LCD display, and the text switches to USB-C and comes back, which means something has been received. Let's consider the device is working fine, I have then two possibilities: first: the device receives incoherent stuff, and does not dare responding, but I got no way to check on the device. (I consider the usbcore tries to send cohenrent stuff!) second: the device is happy to see a request and replies correctly but there's no interrupt fired, whether using SUI_INT_USB (==11) or the SCC3 interrupt (==42) I've been looking for many things allready, but did not find a clue of what might happen... If you have some, I'll be pleased to hear about them. I also had a look at the debug file: ~ # cat /proc/driver/m8xxhci_privateh === Misc stats: sof = 0 isrs = 0 cpm_irqs = 0 overrun = 0 rxb = 0 txb = 0 bsy = 0 sof = 0 txe[0] = 0 txe[1] = 0 txe[2] = 0 txe[3] = 0 nak[0] = 0 nak[1] = 0 nak[2] = 0 nak[3] = 0 to[0] = 0 to[1] = 0 to[2] = 0 to[3] = 0 stall[0] = 0 stall[1] = 0 stall[2] = 0 stall[3] = 0 tx_err = 0 tx_nak = 0 tx_stal = 0 tx_to = 0 tx_un = 0 enqs[ISO] = 0 enqs[INTR] = 0 enqs[CTRL] = 4 enqs[BULK] = 0 cpls[ISO] = 0 cpls[INTR] = 0 cpls[CTRL] = 4 cpls[BULK] = 0 === Periodic schedule: ~ # but as I do not know what might be expected, I do not know what to think about it. The sof, isrs, and cpm_irqs counters confirm that there have been no irqs ... please, help me if you can. and anyway, have fun :) :)
porting linux to new board type
Hi! I stepped over your message without noticing, do you still need help? I do not have much experience yet, as I've been graduated only two month ago, but my job actualy is porting linux to custom boards, and I achieved my first one two weeks ago. So maybe I can hand out some usefull clues. Have fun :) +++
Mailing list
Hi all For the sake of the mailing list (and my own sake) do you know of a mailer tool which handles the in-reply-to field ? And of course, how should the field be set with this particular tool. Thanks a lot.
MPC8555 8280/8270 USB host support
Hi Don't you think u-boot should take care of clock setup i.e. as much as possible of all board dependent stuff ? I think you're right, but then it was easier to make all these setups in the driver itself. If u-boot is the boot loader of your board (the stuff running on it --before-- we see this: loaded at: 0040 005153B4 board data at: 00513130 00513334 relocated to: 00405090 00405294 zimage at: 00405A85 00512099 avail ram: 00516000 0800 Linux/PPC load: rw console=ttyS0 root=/dev/nfs ip=on Uncompressing Linux...done) Then I would say NO If u-boot is this exact stuff (the files in arch/ppc/boot/simple/... misc-embedded.c for example) then, yes, this is somehow better. But (tell me if I'm wrong) this is not really Linux code, and this should be done by Linux. What I think should be good also is the platform files (arch/ppc/platforms/) for this is the place where all the board dependant stuff stays. Maybe I'm completely mistaken. Feel free to tell me (and explain please !) Have fun.
Now booting the kernel
Linux/PPC load: console=ttyS0,9600 root=/dev/xsysace/disc0/part2 rw Uncompressing Linux...done. Now booting the kernel Hi! At this state the bootloader stops executing and the Linux Kernel starts. The problem is that the Linux kernel does not know yet how to use the serial. You won't have any message before it is set up (in early-console if my memory is allright) So what you can do to check what's going on, is put breakpoints in the boot sequence. This means in the file arch/ppc/kernel/head*.S used for your board you should try to comment the line with the tlbwe instruction in the section /* 2. Invalidate all entries except the entry we're executing in */ This will allow you to keep access to your board registers. Then you go step by step, putting some code which will reboot the board when executed, so you know you're going up to that point, and then move the breakpoint further. This code does the reboot (for the booke I can reboot the board by writting '4' at address 0xfa001001): ASM: lis r4,0xfa00 li r5,4 stb r5,0x1001(r4) msync C: *((volatile unsigned char*)0xfa001001 = 4; This way, instead of hanging up, the board reboots and you know where you are. If you're going up to this: bl machine_init /* arch/ppc/kernel/setup.c */ bl MMU_init /* arch/ppc/mm/init.c */ It's quite good, these are C functions, but they are processor specific, once again, check that the ones used (compiled) are those you need. And next you've got the start_kernel call, which leads you to C code definitely. It's in init/main.c. I hope I did not tell anything wrong, and that this will help. Have fun. Nathael.
Three-Speed Ethernet support on MPC8560 (TSEC)
Hi all! I'm working on a port of linux (2.6.13-2) on an Actis-computer board, based on the Freescale MPC8560 Processor. I solved the problems I had with the init process, and I actually have the console (SCC1) and one ethernet controler (FCC3) running. I will now go on with the Three-Speed Ethernet Controler, and there actually seem to be no support for it, but maybe I did not look at the right place? I got another question, about the FCC driver: it uses a big structure fcc_enet_t wich seems to be aimed at stats. This is initialised, but I did not find where this is used. Is it? Thanks.
Three-Speed Ethernet support on MPC8560 (TSEC)
Kumar Gala wrote: I will now go on with the Three-Speed Ethernet Controler, and there actually seem to be no support for it, but maybe I did not look at the right place? The TSEC has been supported for a long time. The driver is call gianfar (drivers/net/gianfar*). OK, I found it, and remembered that at the begining of the port I wondered what the struct platform_device ppc_sys_platform_devices[] was for, now I know. and I'll try this for the FCC3 too. There is a problem though, which I already had (and fixed) with the boot-loader: The gigabit ethernet is not set up correctly: Everything is fine with a Gigabit switch, but with a Fast ethernet switch there is no communication. I'll look for this on monday! Thanks a lot for the help !
kernel panic with VFS unable to mount root fs on 01:00
linuxppc-embedded-request at ozlabs.org wrote: i use MPC862 with 64mb ram on my custom board , i use eldk 3.1.1 , with linux-2.4.25 and ramdisk_image.gz provided by denx eldk , when i boot kernel with ramdisk image , kernel at 0x50 and ramdisk at 0x60 , i get the following message given below , on uboot i use smc2 , on linux i use scc4 , as i got som eproblem getting smc2 up on linux kernel , i get always kernel panic with VFS unable to mount root fs on 01:00 , i used even multi image clubbing vmlinux.gz and ramdisk_image.gz even this gives me the same result , is there something else i should configure or i am missing something else imp , thanks in advance regards neelu __ioremap(): phys addr 03e13000 is RAM lr c000c1c8 RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 4096 bind 8192) NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. Kernel panic: VFS: Unable to mount root fs on 01:00 0Rebooting in 180 seconds.. # # Platform support # CONFIG_PPC=y CONFIG_PPC32=y CONFIG_8xx=y # CONFIG_PPC_STD_MMU is not set CONFIG_SERIAL_CONSOLE=y CONFIG_NOT_COHERENT_CACHE=y CONFIG_MBX=y CONFIG_MATH_EMULATION=y CONFIG_EMBEDDEDBOOT=y # # General setup # # CONFIG_HIGHMEM is not set CONFIG_HIGHMEM_START=0xfe00 CONFIG_LOWMEM_SIZE=0x3000 CONFIG_KERNEL_START=0xc000 CONFIG_TASK_SIZE=0x8000 CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y # # File systems # CONFIG_AUTOFS_FS=y CONFIG_RAMFS=y CONFIG_PROC_FS=y CONFIG_EXT2_FS=y CONFIG_BLK_DEV_RAM_SIZE=4096 You should try with 8K (this solved the problem for me) and on my side the command line root option is root=/dev/ram, but I'm using a ramdisk made by someone else so I do not know much about it, and a 2.6.13 kernel, so this may be different. and before VFS outputs any message, RAMDISK says: RAMDISK: Compressed image found at block 0 VFS: Mounted root (ext2 filesystem). And make sure the file system in the ramfs is ext2.. but I think the message would be different in this case.
Newbie... in mailing lists...
This message is completely out of place here... but... Two things: I tried to reply to this thread: http://ozlabs.org/pipermail/linuxppc-embedded/2005-October/020555.html But it created a new one. not good. I tried to look for advices on posting and replying on the mailling list... but the links given there: https://ozlabs.org/mailman/listinfo/linuxppc-embedded for the rules (http://lists.linuxppc.org/rules.html) and posting guidlines (http://lists.linuxppc.org/guidelines.html) are down. Who can fix it, and tell me where to find the guidelines (or How to reply to a thread) Thanks.
init process not running
Hi, I'm porting the kernel (tried a 2.6.9 and 2.6.13) to an ACTIS Computer board (MPC8560, e500 core), and I have a strange problem. Everything seems all right, but the init process does not start. I have an echo from the tty (cpm2 SCC1), so the kernel is not crashed. I even got the ticker. I first thought I had a problem with the console but if I use another init process (using another process from the ramdisk, mke2fs), nothing happens either. I tried to replace the init process by another process which simply returns (eventually after a printf(Hello world) ), so the kernel would panic, but still nothing. Tried to create a syscall which reboots the board, and call it from the hello_world, nothing. Tried to use an init=/unexisting/process, and this skips to the next possibility (/sbin/init), so the ramfs seem good, tried another ramfs, which is running correctly on annother ppc board, but still the same problem. anyhow the do_execve is successfull. The scheduler seems to be scheduling pid 3 and 8, it tries to wake up pid 1, but its old_state is 0. changing the state to 1 in start_thread does not fix this. when a task is created, usualy wake_up_new_task is called, but not here (but this is the first task using execve). Does anyone have a clue about what I did wrong, or where and what to look at? Thanks a lot for your help. Following two traces of the boot process, one with the 2.6.9, one with the 2.6.13.2 Here is a trace of the boot process with the 2.6.9 kernel (# represent the second): Loading ELF headers...done Loading segment #0 at 0x0080e Loading extra data at 0x00a33000done Lowest address: 0x0080 Entry address: 0x0080 Highest address: 0x00a3474e Bytes loaded:2312014 loaded at: 0080 00A353CC board data at: 00A3312C 00A3334C relocated to: 00805090 008052B0 zimage at: 00805A21 00892EB8 initrd at: 00893000 00A32F88 avail ram: 00A36000 2000 Linux/PPC load: rw console=ttyS0 root=/dev/ram0 init=/sbin/nath Uncompressing Linux...done Memory CAM mapping: CAM0=256Mb, CAM1=256Mb, CAM2=0Mb residual: 0Mb Linux version 2.6.9-3 #174 Thu Oct 6 11:34:23 CEST 2005 cpm2_immr address (0xfff8) remapped to 0xfdfc Built 1 zonelists Kernel command line: rw console=ttyS0 root=/dev/ram0 init=/sbin/nath OpenPIC Version 1.2 (1 CPUs and 44 IRQ sources) at fdb7d000 PID hash table entries: 4096 (order: 12, 65536 bytes) ###Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) #Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) #Memory: 516096k available (888k kernel code, 340k data, 68k init, 0k highmem) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) NATH: rest_init: going to kernel_thread checking if image is initramfs...##it isn't (no cpio magic); looks like an initrd Freeing initrd memory: 1663k freed Linux NoNET1.0 for Linux 2.6 #6PCI: Probing PCI hardware Serial: CPM driver $Revision: 0.01b $ ttyS0 at MMIO 0xfdfd1a00 (irq = 40) is a CPM UART #RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize loop: loaded (max 8 devices) Using anticipatory io scheduler ###VFS: NATH: fs_names = ext2, name = /dev/root VFS: Mounted root /dev/root (ext2 filesystem). NATH: init: run_init_process, /sbin/nath NATH: init: run_init_process, /sbin/init # Here is a trace of the boot process with the 2.6.13 kernel: Loading ELF headers...done Loading segment #0 at 0x0080...e Loading extra data at 0x00a41000done Lowest address: 0x0080 Entry address: 0x0080 Highest address: 0x00a6ad8e Bytes loaded:2534798 loaded at: 0080 00A433CC board data at: 00A4112C 00A4134C relocated to: 00805090 008052B0 zimage at: 00805A71 008A020B initrd at: 008A1000 00A40F88 avail ram: 00A44000 2000 Linux/PPC load: rw console=ttyS0 root=/dev/ram Uncompressing Linux...done. Now booting the kernel Memory CAM mapping: CAM0=256Mb, CAM1=256Mb, CAM2=0Mb residual: 0Mb Linux version 2.6.13-3 (nathael at linux-bbe) (gcc version 3.3.3) #62 Wed Oct 12 10:43:49 CEST 2005 cpm2_immr address (0xfff8) remapped to 0xfdfc Built 1 zonelistchecking if image is initramfs...it isn't (no cpio magic); looks like an initrd Freeing initrd memory: 1663k freed s Kernel command line: rw console=ttyS0 root=/dev/ram OpenPIC Version 1.2 (1 CPUs and 44 IRQ sources) at fdb7d000 PID hash table entries: 4096 (order: 12, 65536 bytes) Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) Memory: 515968k available (952k kernel code, 484k data, 88k init, 0k highmem) Mount-cache hash table entries: 512 checking if image is initramfs...it isn't (no cpio magic); looks like an initrd