io.h question
An HTML attachment was scrubbed... URL: http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20060105/d5d763e5/attachment.htm
[CFT 14/29] Add vio_bus_type probe and remove methods
Signed-off-by: Russell King --- arch/powerpc/kernel/vio.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff -up -x BitKeeper -x ChangeSet -x SCCS -x _xlk -x *.orig -x *.rej -x .git linus/arch/powerpc/kernel/vio.c linux/arch/powerpc/kernel/vio.c --- linus/arch/powerpc/kernel/vio.c Wed Nov 9 19:20:14 2005 +++ linux/arch/powerpc/kernel/vio.c Sun Nov 13 16:14:10 2005 @@ -76,7 +76,7 @@ static void vio_bus_shutdown(struct devi struct vio_dev *viodev = to_vio_dev(dev); struct vio_driver *viodrv = to_vio_driver(dev->driver); - if (viodrv->shutdown) + if (dev->driver && viodrv->shutdown) viodrv->shutdown(viodev); } @@ -91,9 +91,6 @@ int vio_register_driver(struct vio_drive /* fill in 'struct driver' fields */ viodrv->driver.bus = &vio_bus_type; - viodrv->driver.probe = vio_bus_probe; - viodrv->driver.remove = vio_bus_remove; - viodrv->driver.shutdown = vio_bus_shutdown; return driver_register(&viodrv->driver); } @@ -295,4 +292,7 @@ struct bus_type vio_bus_type = { .name = "vio", .hotplug = vio_hotplug, .match = vio_bus_match, + .probe = vio_bus_probe, + .remove = vio_bus_remove, + .shutdown = vio_bus_shutdown, };
[CFT 13/29] Add of_platform_bus_type probe and remove methods
Signed-off-by: Russell King --- arch/powerpc/kernel/of_device.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -up -x BitKeeper -x ChangeSet -x SCCS -x _xlk -x *.orig -x *.rej -x .git linus/arch/powerpc/kernel/of_device.c linux/arch/powerpc/kernel/of_device.c --- linus/arch/powerpc/kernel/of_device.c Mon Oct 31 07:31:59 2005 +++ linux/arch/powerpc/kernel/of_device.c Sun Nov 13 16:12:38 2005 @@ -132,6 +132,8 @@ static int of_device_resume(struct devic struct bus_type of_platform_bus_type = { .name = "of_platform", .match = of_platform_bus_match, + .probe = of_device_probe, + .remove = of_device_remove, .suspend= of_device_suspend, .resume = of_device_resume, }; @@ -150,8 +152,6 @@ int of_register_driver(struct of_platfor /* initialize common driver fields */ drv->driver.name = drv->name; drv->driver.bus = &of_platform_bus_type; - drv->driver.probe = of_device_probe; - drv->driver.remove = of_device_remove; /* register with core */ count = driver_register(&drv->driver);
powerpc vs ppc build
On Thursday 05 January 2006 08:05, David Jander wrote: > Looks to me like ppc and ppc64 are deprecated and "phased out" in favour of > powerpc. ppc64 is no more in 2.6.15, building the kernel on a ppc64 system will automatically use ARCH=powerpc. > If you look at the contents of both the include/asm-ppc and > include/asm-powerpc directories over the last revisions for example, you'll > see files moving from asm-ppc to asm-powerpc. Now, they are in a kind of flux > still, so you'll probably find yourself doing silly things like "ln -s > include/asm-powerpc/* include/asm-ppc/" to keep things working and compiling > nicely. That should never be needed. You should always be able to do both $ make ARCH=ppc randomconfig O=../obdir1 && make ARCH=ppc O=../obdir2 and $ make ARCH=powerpc randomconfig O=../objdir2 && make ARCH=powerpc O=../obdir2 and build successfully with that. If it doesn't, report a bug. > I do hope this is over soon. I fear it might take a somewhat longer time. AFAICS, the idea is to remove all platforms from ppc, one at a time, as soon as they are working well enough with ARCH=powerpc or are known to be unmaintained. At that point, the arch/ppc/ tree can be removed completely. The catch is that this needs work from each platform maintainer that wants his hardware to be supported in future kernels (or at least the information that he/she doesn't care if it gets removed). > On Wednesday 04 January 2006 23:44, Jeff Angielski wrote: > > Is there a summary of the differences between the ppc and powerpc builds > > for the 2.6 kernels? Or something describing what the community, in > > general, is trying to fix/address with the different schemes - besides > > the merging of ppc and ppc64? I'm only a ppc64 person, so I don't know the state that the current 51 platform types from arch/ppc/Kconfig or any of the out-of-tree ones are in, but if you are maintaining one of them that does not yet work with ARCH=powerpc, I suggest you do the following: 1. If the platform is not already based on open firmware or the equivalent flat device tree representation, build a device tree for it, using the specification from http://ozlabs.org/~dgibson/dtc/ (you need to use git to check out the repository). 2. See if there is already a platform type for your hardware present in arch/powerpc. Note that a powerpc platform is a lot more generic than a ppc machine type, so you almost never need to add a new one here. E.g. every board based on a 4xx should be able to use the same platform type. The rule is that enabling support for some hardware should never force you to disable support for other hardware. 3. Move over all device drivers that are still missing in powerpc. Make sure that the drivers don't contain any hardcoded assumptions about your hardware that may be different for other board. I/O addresses and such stuff should come from the device tree. Moreover, the driver should not touch any I/O if someone loads it on a board that does not have the device. 4. Submit a patch series to linuxppc-dev that integrates your changes, following Documentation/SubmittingPatches, and mark your arch/ppc code as deprecated with a deadline saying at what time it will be removed (or remove it right away with another patch). Arnd <><
mmap
Brett McNerney wrote: [...] >I am open for other options on how I can do this other then mmap. And am still not against a driver >built into the kernel if someone has a an example I could see and can explain how to add it in so it >builds into the kernel since I have had no success on that either and have tried a couple different >tutorials I found online with no success. Ah, this is the first one of 2006. Happy new year! Your question is a linuxppc-embedded FAQ, coming at least every 3 months here. It is documented in Denx's FAQ[1], and accessible through shorter URL[2]. For more information, please follow this thread[3] (not ppc specific actually). A good book of C language about what are pointers and how scanf works might help too in case of confusion :-) [1] http://www.denx.de/twiki/bin/view/PPCEmbedded/DeviceDrivers#Section_Acce ssingPeripheralsFromUserSpace [2] http://tinyurl.com/6c7th [3] http://lists.linuxppc.org/linuxppc-embedded/200403/msg00059.html Regards, -- Stephane
[PATCH] fix ML300 zImage in 2.6.15
2.6.15 doesn't build a bootable zImage for the ML300 because embed_config.o is no longer linked in. This patch adds it back in. Signed-off-by: Grant Likely diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile index f3e9c53..5699659 100644 --- a/arch/ppc/boot/simple/Makefile +++ b/arch/ppc/boot/simple/Makefile @@ -188,6 +188,7 @@ OBJCOPY_ARGS:= -O elf32-powerpc boot-y := head.o relocate.o $(extra.o-y) $(misc-y) boot-$(CONFIG_REDWOOD_5) += embed_config.o boot-$(CONFIG_REDWOOD_6) += embed_config.o +boot-$(CONFIG_XILINX_ML300)+= embed_config.o boot-$(CONFIG_8xx) += embed_config.o boot-$(CONFIG_8260)+= embed_config.o boot-$(CONFIG_BSEIP) += iic.o -- Grant Likely, B.Sc. P.Eng. Secret Lab Technologies Ltd. (403) 663-0761
Porting of Linux on MPC8260 custom build board
Hello, Linux is able to uncompress into SDRAM. We mapped SDRAM from 0x0. It is getting stuck at mounting root fs. We have mounted the root fs by NSF. Possibly it is not able to contact the server where it's FS is mounted. Pls find the following log and help me to bring up Linux. Our board has single ethernet and uses FCC1 with LXT971 driver. The board does not have BCSR. **LOG START* U-BOOT=> boot, m 0400 ## Booting image at 0400 ... Image Name: Linux-2.4.25 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size:661935 Bytes = 646.4 kB Load Address: Entry Point: Verifying Checksum ... OK Uncompressing Kernel Image ... OK ## Current stack ends at 0x07B87CA8 => set upper limit to 0x0080 ## cmdline at 0x007FFF00 ... 0x007FFF13 bd address = 0x07B87FB4 memstart= 0x memsize = 0x0800 flashstart = 0xFE00 flashsize = 0x0010 flashoffset = 0x00032000 sramstart = 0xFFF0 sramsize= 0x0020 immr_base = 0xF000 bootflags = 0x0001 vco =248 MHz sccfreq = 62 MHz brgfreq = 15.500 MHz intfreq =186 MHz cpmfreq =124 MHz busfreq = 62 MHz ethaddr = 00:0B:17:00:00:00 IP addr = 172.18.16.220 baudrate= 57600 bps No initrd ## Transferring control to Linux (at address ) ... Memory BAT mapping: BAT2=128Mb, BAT3=0Mb, residual: 0Mb Linux version 2.4.25 (cdot at myserver.com) (gcc version 3.3.3 (DENX ELDK 3.1.1 3.3.3-9)) #3 Wed Jan 4 15:48:00 IST 2006 On node 0 totalpages: 32768 zone(0): 32768 pages. zone(1): 0 pages. zone(2): 0 pages. Kernel command line: root=/dev/mtdblock2 Warning: real time clock seems stuck! Calibrating delay loop... 123.69 BogoMIPS Memory: 127932k available (1136k kernel code, 400k data, 52k init, 0k highmem) Dentry cache hash table entries: 16384 (order: 5, 131072 bytes) Inode cache hash table entries: 8192 (order: 4, 65536 bytes) Mount cache hash table entries: 512 (order: 0, 4096 bytes) Buffer cache hash table entries: 8192 (order: 3, 32768 bytes) Page-cache hash table entries: 32768 (order: 5, 131072 bytes) POSIX conformance testing by UNIFIX Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket Starting kswapd JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc. CPM UART driver version 0.01 ttyS0 on SMC1 at 0x, BRG7 ttyS1 on SMC2 at 0x0040, BRG8 ttyS2 on SCC1 at 0x8000, BRG1 ttyS3 on SCC2 at 0x8100, BRG2 pty: 256 Unix98 ptys configured 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 1024 buckets, 8Kbytes TCP: Hash tables configured (established 8192 bind 16384) NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. VFS: Cannot open root device "mtdblock2" or 1f:02 Please append a correct "root=" boot option Kernel panic: VFS: Unable to mount root fs on 1f:02 <0>Rebooting in 180 seconds.. ***LOG END*** Thanks Batsayan Das Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -- next part -- An HTML attachment was scrubbed... URL: http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20060105/fdf67731/attachment.htm
powerpc vs ppc build
On Wednesday 04 January 2006 23:44, Jeff Angielski wrote: > Is there a summary of the differences between the ppc and powerpc builds > for the 2.6 kernels? Or something describing what the community, in > general, is trying to fix/address with the different schemes - besides > the merging of ppc and ppc64? Looks to me like ppc and ppc64 are deprecated and "phased out" in favour of powerpc. If you look at the contents of both the include/asm-ppc and include/asm-powerpc directories over the last revisions for example, you'll see files moving from asm-ppc to asm-powerpc. Now, they are in a kind of flux still, so you'll probably find yourself doing silly things like "ln -s include/asm-powerpc/* include/asm-ppc/" to keep things working and compiling nicely. I do hope this is over soon. Greetings, -- David Jander
VFS: Cannot open root device "31:03" or unknown-block(31,3)
On Thursday 05 January 2006 04:29, you wrote: > Hi, David, > I get the complete bootlog and .config here. Please see the > attached files. I copy the bootlog into .config. > And my NFS can mount root file system ok, but can not > execute any program. Once the program load into system and > run, the system crash. > I am new in this field and thank you for your help. > Regards, > /HappyPhot in your .config: > CONFIG_JFFS2_FS=m This is wrong. You have to choose "y", not "m" (for module). This way jffs2 is compiled as a module. That means, that jffs2 filesystem will not be available until the module is loaded with "insmod jffs2" of something similar. That in turn means that your system has to start up first in order to be able to do this, but since you can't start because your root filesystem is on jffs2, you have created yourself a "chicken and egg" problem. If you choose "y" then jffs2 support will be compiled into the kernel, and thus be available before booting. In your bootlog: > Linux version 2.6.14.2 (happy at sddlinux1) (gcc version 3.3.3 (DENX ELDK > 3.1.1 > 3.3.3-10)) #29 Sun Jan 1 22:34:28 CST 2006 > Motorola SPS Sandpoint Test Platform I see you are using DENX ELDK 3.1.1 and a kernel which AFAIK is not supported by this version of ELDK. Are you sure this is supposed to work? It probably will, but I don't know what the "Sandpoint" is (it looks like a PowerPC processor of the MPC7xx series to me), so I couldn't tell. Greetings, -- David Jander
Porting of Linux on MPC8260 custom build board
Hello Batsayan Das, [...] > zone(2): 0 pages. > Kernel command line: root=/dev/mtdblock2 I think you do not use NFS as root fs. Try something like root=/dev/nfs in the Kernel command line, or read http://www.denx.de/wiki/view/DULG/LinuxNfsRoot Best regards Heiko
[PATCH] boot/common/util.S: Put flush_{instruction, data}_cache back in .relocate_code section
On Wed, Jan 04, 2006 at 09:40:48PM -0800, Paul Janzen wrote: > In 2.6.14, we had the following definition of _GLOBAL() in > include/asm-ppc/processor.h: > > #define _GLOBAL(n)\ > .stabs __stringify(n:F-1),N_FUN,0,0,n;\ > .globl n;\ > n: > > In 2.6.15, as part of the great powerpc merge, we moved this definition to > include/asm-powerpc/ppc_asm.h, where it appears (to 32-bit code) as: > > #define _GLOBAL(n) \ > .text; \ > .stabs __stringify(n:F-1),N_FUN,0,0,n;\ > .globl n; \ > n: > > Mostly, this is fine. However, we also have the following, in > arch/ppc/boot/common/util.S: > > .section ".relocate_code","xa" > [...] > _GLOBAL(flush_instruction_cache) > [...] > _GLOBAL(flush_data_cache) > [...] > > The addition of the .text section definition in the definition of > _GLOBAL overrides the .relocate_code section definition. As a result, > these two functions don't end up in .relocate_code, so they don't get > relocated correctly, and the boot fails. > > There's another suspicious-looking usage at kernel/swsusp.S:37 that > someone should look into. I did not exhaustively search the source > tree, though. > > The following is the minimal patch that fixes the immediate problem. > I could easily be convinced that the _GLOBAL definition should be > modified to remove the ".text;" line either instead of, or in addition > to, this fix. > > Signed-off-by: Paul Janzen Thanks for tracking this one down. Paul, can you please make sure this gets to Linus and the stable team? Thanks. Acked-by: Tom Rini > --- arch/ppc/boot/common/util.S~ 2005-12-24 15:47:48.0 -0800 > +++ arch/ppc/boot/common/util.S 2006-01-04 14:07:12.0 -0800 > @@ -234,7 +234,8 @@ udelay: > * First, flush the data cache in case it was enabled and may be > * holding instructions for copy back. > */ > -_GLOBAL(flush_instruction_cache) > +.globl flush_instruction_cache > +flush_instruction_cache: > mflrr6 > bl flush_data_cache > > @@ -279,7 +280,8 @@ _GLOBAL(flush_instruction_cache) > * Flush data cache > * Do this by just reading lots of stuff into the cache. > */ > -_GLOBAL(flush_data_cache) > +.globl flush_data_cache > +flush_data_cache: > lis r3,cache_flush_buffer at h > ori r3,r3,cache_flush_buffer at l > li r4,NUM_CACHE_LINES > > -- Paul -- Tom Rini http://gate.crashing.org/~trini/
mmap
I have been trying to work with mmap to read and write to a custom hardware module on a Xilinx virtex 4 board with linux running on the ppc. But I have gotten many different errors. But the main one I am seeing is segmentation error. Below is the code I am using. The device has a 256 address size specified in the Xilinx tools and the base address I set in the Xilinx tools was 0x8100. Am I doing something wrong in the code? Any help would be greatly appreciated as we have decided to try this method instead of using a driver built into the kernel as this allows us some more flexibility. Also the hardware module I am using for testing contains 3 hardware registers which adds two of the registers and returns the result in the third one. I am open for other options on how I can do this other then mmap. And am still not against a driver built into the kernel if someone has a an example I could see and can explain how to add it in so it builds into the kernel since I have had no success on that either and have tried a couple different tutorials I found online with no success. Thanks for any help anyone can provide. Brett #include #include #include #include #include int main(void) { int fd; int *p; fd = open("/dev/mem, O_RDWR); p = (int *)mmap(0, 256, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0x8100); if (p == MAP_FAILED) { printf("Err: cannot access adder!/n"); return -1; } printf("input two numbers: "); scanf("%d", &p); scanf("%d", &p+1); printf("%d + %d = %d\n", *p, *(p+1), *(p+2)); munmap(p,256); close(fd); return 0; } -- next part -- An HTML attachment was scrubbed... URL: http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20060105/f9fc9893/attachment.htm
Porting of Linux on MPC8260 custom build board
batsayan.das at tcs.com wrote: > > [...] We have mounted the root fs by NSF. Really ? The following boot command says you intended otherwise ! > Kernel command line: root=/dev/mtdblock2 [...] > Please append a correct "root=" boot option Indeed ! Provide the correct root option to mount over nfs. Denx FAQ covers all these. Regards Sinan Akman