RE: [PATCH] sata_fsl: add workaround for data length mismatch on freescale V2 controller
> The freescale V2 SATA controller checks > if the received data length matches > the programmed length 'ttl', if not, > it assumes that this is an error. ... Can you tell us exactly what "The freescale V2 SATA controller" is, and what versions of what devices contain it? Thanks, Clive ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: Problem in phy.c, when using fixed network speed
> Hi all, > during testing i encountered a problem with setting > up a 5200B controller with a MICREL phy at static > 100MBit full duplex - without autonegotiation. > > I performed this as usual with ethtool and was > succesful when i had my link partner up, providing > a link. > > When kepping the link partner off, meaning no link > at all, my machine started to degrade its link > capabilities ending 10MBit half duplex. > > I tracked it down to drivers/net/phy/phy.c: > in the function phy_state_machine, the case block > PHY_FORCING causes this (at least for me) undesired > behaviour. Calling the phy_force_reduction function > degrades actually an intentionally static setup. > > I deactivated those lines, and it works for me. > > But anyhow i feel soe need to have a general > solution that takes static non autonagotiation > setups into account. > > What do you think? > > Hope to hear from you > > Michael Yes, I have encountered this before. I think it dates back to before Auto Negotiation became part of the IEEE802* standard and each manufacturer implemented its own strategy to establish a link. Although it is possible "by experiment" to find the speed of your link partner, it is impossible to determine its Full/Half Duplex mode. IMHO when a fixed speed and duplex setting is applied, phy.c should keep that setting regardless of whether or not the link is established. Not only is this undesirable behaviour, but it deviates from the standard. Clive ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: reserving memory using OF rsvmap feature?
> Is it possible to reserve some memory using OF rsvmap such that Linux > will not touch this area at all? Think of is as warm start stash area > were one could store data which should survive a reboot. Yes, I guess it should be possible, but you need to take care where you place this block so it does not get overwritten during the boot process. This depends on how your bootloader is set up to place images in memory, decompress them etc. I don't know about OF, but in U-Boot use the function fdt_add_mem_rsv() in file http://git.denx.de/?p=u-boot.git;a=blob;f=lib/libfdt/fdt_rw.c // Reserve the memory location of the framebuffer + descriptor page. if (fdt_add_mem_rsv(working_fdt, fbinfo->smem_start, (fbinfo->smem_len + 0x1FFF) & 0xF000)) printf("ERROR: could not reserve FB memory in device tree\n"); In my powerpc_e500v2 systems this block is located at 64MiB (0x0400). Clive ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: userspace o/p to kernel buffer
> How do I capture all the output of user-space programs into > a kernel buffer so that I can later read it using debugger ? > My board doesn't have a console (no serial, no network). Assuming you are using a shell to start your user-space programs, you could easily redirect output to /dev/kmsg then find it in the dmesg buffer afterwards. You may need to increase the buffer size. Clive ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH 1/3] mtd/nand: fix coding style issue in drivers/mtd/nand/fsl_elbc.c
> > > fix whitespaces,tabs coding style issue and ... > > > > In my opinion this code was already correct, and would display correctly > > at any TAB setting. This patch changes it so that it displays > > incorrectly at all TAB settings other than 8. > > Any tab setting other than 8 is incorrect and should not be used for > Linux code. This may be your (not so humble :-) opinion, and I happen to agree that a tab setting of 8 is best, usually. However, as Linus says in his coding style document "Coding style is very personal, and I won't _force_ my views on anybody". > ... Fix your editor, if that's an issue for you. My editor has a tab setting of 8, but readers of this list have diverse email clients, some of which do not display 8 spaces per tab. Clive ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH 1/3] mtd/nand: fix coding style issue in drivers/mtd/nand/fsl_elbc.c
> fix whitespaces,tabs coding style issue and ... In my opinion this code was already correct, and would display correctly at any TAB setting. This patch changes it so that it displays incorrectly at all TAB settings other than 8. Example: Correct: function(arg1, <9spaces>arg2 Incorrect: function(arg1, < tab > arg2 For any TAB setting other than 8, arg1 and arg2 no longer line up. Clive ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH] fsl-diu-fb: remove the ioctl interface
> > The ioctl interface in the Freescale DIU framebuffer driver is just a > > collection of miscellaneous functions which were only used in a one-time > > demo application that was never distributed. Plus, the ioctls were spread > > across two types (both conflicting), and the demo app didn't even use all > > of them. > > > > Removing the ioctl interface also allows us to clean up the header file and > > remove other unusued stuff. > > No! We are using ioctl interface of this driver in many video > rendering applications on overlay planes on huge number of boards. > So, please don't remove it. > > Anatolij Can you make available your application code by posting a link to it? Thanks, Clive ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: Freescale P2020/ 85xx PCIe: DMA low throughtput
> Hi, > > I'm working on bring up for a new board based on Freescales p2020. > I have a programmable FPGA as a PCIe device with a buffer I can > write to and from. > I want to test performence for the PCIe bus. > I encountered a problem while doing a DMA between the FPGA & DDR. > The whole buffer moves to and from the device with out > mismatches but with low throughtput. > The thing is that the buffer divided to many transactions of byte > size instead of transferring it in a burst. > I must mention that even a buffer of word size, divided in to byte > transactions by the DMA (the core can read a word so it seems like > the DMA fault. > I tried to change the latency timer, max latency, min latency and > cache line in the configuration space of both sides of the pcie > bus. It didn't help. > Do you have an idea what can it be? > > Thanks, > Natalie. > > > > Assuming the P2020 has the usual 85xx-style DMA engine, you may have > the Band Width Control cleared to 0. This 4-bit field (BWC) restricts > the transfer size to 2^BWC bytes, for BWC=0,1,..0xa. 0xb-0xe are > reserved. 0xf disables bandwidth sharing to allow uninterrupted > transfers from each channel, so if you are using several channels > one channel can completely lock out other channels. BWC=0x8 at reset > (2^8 = 256 bytes). See the P2020 manual for more details. > > BWC is the field with mask 0x0f00 in the MR (Master Reset) > register for the channel (0, 1, 2, 3), at offset 0x100, 0x180, 0x200, > 0x280 relative to the base of the DMA controller. > > Clive > > > > > Hi, Thanks. > I changed the BWC but the transactions are still in a byte size instead > of burst. Do you have another idea? > > Natalie. Sorry, no. Are you sure you have modified the FSL-DMA driver in the kernel so it does not write zero to BWC? Clive ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: Freescale P2020/ 85xx PCIe: DMA low throughtput
> Hi, > > I'm working on bring up for a new board based on Freescales p2020. > I have a programmable FPGA as a PCIe device with a buffer I can > write to and from. > I want to test performence for the PCIe bus. > I encountered a problem while doing a DMA between the FPGA & DDR. > The whole buffer moves to and from the device with out > mismatches but with low throughtput. > The thing is that the buffer divided to many transactions of byte > size instead of transferring it in a burst. > I must mention that even a buffer of word size, divided in to byte > transactions by the DMA (the core can read a word so it seems like > the DMA fault. > I tried to change the latency timer, max latency, min latency and > cache line in the configuration space of both sides of the pcie > bus. It didn't help. > Do you have an idea what can it be? > > Thanks, > Natalie. Assuming the P2020 has the usual 85xx-style DMA engine, you may have the Band Width Control cleared to 0. This 4-bit field (BWC) restricts the transfer size to 2^BWC bytes, for BWC=0,1,..0xa. 0xb-0xe are reserved. 0xf disables bandwidth sharing to allow uninterrupted transfers from each channel, so if you are using several channels one channel can completely lock out other channels. BWC=0x8 at reset (2^8 = 256 bytes). See the P2020 manual for more details. BWC is the field with mask 0x0f00 in the MR (Master Reset) register for the channel (0, 1, 2, 3), at offset 0x100, 0x180, 0x200, 0x280 relative to the base of the DMA controller. Clive ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: Booting MPC8377ERBD from NAND flash
> I am trying to boot MPC8377ERBD freescale board from NAND flash. > As per its specifications, it supports NAND boot but it there is > no support for NAND boot in the BSP(confirmed with freescale also). > Now I decided to modify BSP myself to support NAND boot and I am > confused that from where should I start. Please suggest. Read this http://www.freescale.com/files/32bit/doc/app_note/AN3201.pdf and other documentation on the Freescale site Clive ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: Timestamp in PowerPC 440
> I have ported Linux 2.6 to PowerPC 440. Could you tell me > how it is possible to access the timebase register (TBU, TBL) > from user space (in Linux) because I want to measure the time > of an application that runs in Linux? I just grabbed this code from the kernel (you can put the macro expansions into the function if you like): typedef unsigned long long u64; #define mftbl() ({unsigned long rval; \ asm volatile("mftbl %0" : "=r" (rval)); rval;}) #define mftbu() ({unsigned long rval; \ asm volatile("mftbu %0" : "=r" (rval)); rval;}) static inline u64 get_tb(void) { unsigned int tbhi, tblo, tbhi2; do { tbhi = get_tbu(); tblo = get_tbl(); tbhi2 = get_tbu(); } while (tbhi != tbhi2); return ((u64)tbhi << 32) | tblo; } The timebase frequency is available in text form from /proc/cpuinfo and in binary (as a 4-byte bigendian integer)from /proc/device-tree/... grep timebase /proc/cpuinfo find /proc/device-tree -name timebase-frequency -print \ -exec od -td -An '{}' \; Clive ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: Proc/CpuInfo - Timebase
> On a powerpc system running linux, when I see cat /proc/cpuinfo, I > find the value of timebase. Can somebody suggest on what is that, and > how is it used? It is the frequency (in Hz) of the clock that increments the Time Base Register (TBR). After reading TBR (or calculating a difference between two TBR values) you can use "timebase" to convert to real time units, such as microseconds/nanoseconds/picoseconds. For debugging I log events together with a TBR reading, which I can later convert to a time from reset (or a time from the moment when the kernel initialised TBR to zero, which happens in some kernels). Clive ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: Trace
> Why can't tty have value 0x5741 ? To answer my own question, because it ends in 1 and is not word-aligned! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jenkins, Clive Sent: 01 September 2008 14:54 To: Sébastien Chrétien Cc: linuxppc-dev@ozlabs.org Subject: RE: Trace I'm not sure that is a failure. Why can't tty have value 0x5741 ? I think the code in tty_io.c initialises driver->ttys and you shouldn't need to do anything in your driver. If you are not already aware, a useful way to explore kernel code is to use LXR: http://lxr.linux.no/linux+v2.6.26/include/linux/tty_driver.h#L212 This may help you understand the tty code. Good luck! From: Sébastien Chrétien [mailto:[EMAIL PROTECTED] Sent: 01 September 2008 13:25 To: Jenkins, Clive Cc: linuxppc-dev@ozlabs.org Subject: Re: Trace I found where is the failure with your advices In init_dev (tty_io.c), init_dev calls "tty = driver->ttys[idx]" after this call, tty value is : tty = 0x5741 Have I to initialize driver->ttys in my driver. If yes, how have I to Initialize this ? The driver tty is used in order to have a console on my serial port. Thanks for your help 2008/9/1, Jenkins, Clive <[EMAIL PROTECTED]>: The instruction that caused the fault is at this address: > NIP [c0110ddc] init_dev+0x2bc/0x584 The hex value of the instruction is also highlighted between <> here: > Instruction dump: > 7d808120 4e800020 7c832378 4bfa9ea9 7c7f1b79 418201f0 a81e0062 2f81 > 409efd98 83ff00d0 2c1f 4182fd90 <801f00b8> 70090080 408201b0 801e0060 Disassemble your kernel and look at offset 0x2BC relative to the label init_dev From: [EMAIL PROTECTED] [mailto:linuxppc-dev-bounces+clive.jenkins <mailto:linuxppc-dev-bounces%2Bclive.jenkins> [EMAIL PROTECTED] On Behalf Of Sébastien Chrétien Sent: 01 September 2008 10:16 To: linuxppc-dev@ozlabs.org Subject: Trace Hello, I am triying to write a tty_driver under ppc. And I get a kernel panic. Can somebody explain me how finding the source of the error with a kernel panic trace : thanks Unable to handle kernel paging request for data at address 0x57f9 Faulting instruction address: 0xc0110ddc Oops: Kernel access of bad area, sig: 11 [#1] Modules linked in: NIP: c0110ddc LR: c08c CTR: REGS: cf01bcb0 TRAP: 0300 Not tainted (2.6.26) MSR: 9032 CR: 44002022 XER: 2000 DAR: 57f9, DSISR: 4000 TASK = cf01c000[1] 'swapper' THREAD: cf01a000 GPR00: 000c cf01bd60 cf01c000 cf04c300 cf01bdbc c01d GPR08: 1249 fffc cf000420 84002022 1b00 007fff00 GPR16: 0fffa1d0 0004 cf01bdbc 007ffec0 0080 GPR24: c01b7650 0002 c01d ce4a6700 cf04c300 5741 NIP [c0110ddc] init_dev+0x2bc/0x584 LR [c08c] tty_open+0xe8/0x3e0 Call Trace: [cf01bd60] [cf01bd78] 0xcf01bd78 (unreliable) [cf01bdb0] [c08c] tty_open+0xe8/0x3e0 [cf01bde0] [c00742c8] chrdev_open+0x114/0x1b0 [cf01be10] [c006fb5c] __dentry_open+0x190/0x2e8 [cf01be40] [c006fdac] nameidata_to_filp+0x38/0x70 [cf01be60] [c007bc60] do_filp_open+0x200/0x7d0 [cf01bf10] [c00700b4] do_sys_open+0x74/0x114 [cf01bf40] [c0003c94] init_post+0x34/0x258 [cf01bf60] [c019ca64] kernel_init+0x258/0x270 [cf01bff0] [c0011b3c] kernel_thread+0x44/0x60 Instruction dump: 7d808120 4e800020 7c832378 4bfa9ea9 7c7f1b79 418201f0 a81e0062 2f81 409efd98 83ff00d0 2c1f 4182fd90 <801f00b8> 70090080 408201b0 801e0060 ---[ end trace b7795a387aeb7786 ]--- Kernel panic - not syncing: Attempted to kill init! allocation failed: out of vmalloc space - use vmalloc= to increase size. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
RE: Trace
I'm not sure that is a failure. Why can't tty have value 0x5741 ? I think the code in tty_io.c initialises driver->ttys and you shouldn't need to do anything in your driver. If you are not already aware, a useful way to explore kernel code is to use LXR: http://lxr.linux.no/linux+v2.6.26/include/linux/tty_driver.h#L212 This may help you understand the tty code. Good luck! From: Sébastien Chrétien [mailto:[EMAIL PROTECTED] Sent: 01 September 2008 13:25 To: Jenkins, Clive Cc: linuxppc-dev@ozlabs.org Subject: Re: Trace I found where is the failure with your advices In init_dev (tty_io.c), init_dev calls "tty = driver->ttys[idx]" after this call, tty value is : tty = 0x5741 Have I to initialize driver->ttys in my driver. If yes, how have I to Initialize this ? The driver tty is used in order to have a console on my serial port. Thanks for your help 2008/9/1, Jenkins, Clive <[EMAIL PROTECTED]>: The instruction that caused the fault is at this address: > NIP [c0110ddc] init_dev+0x2bc/0x584 The hex value of the instruction is also highlighted between <> here: > Instruction dump: > 7d808120 4e800020 7c832378 4bfa9ea9 7c7f1b79 418201f0 a81e0062 2f81 > 409efd98 83ff00d0 2c1f 4182fd90 <801f00b8> 70090080 408201b0 801e0060 Disassemble your kernel and look at offset 0x2BC relative to the label init_dev From: [EMAIL PROTECTED] [mailto:linuxppc-dev-bounces+clive.jenkins <mailto:linuxppc-dev-bounces%2Bclive.jenkins> [EMAIL PROTECTED] On Behalf Of Sébastien Chrétien Sent: 01 September 2008 10:16 To: linuxppc-dev@ozlabs.org Subject: Trace Hello, I am triying to write a tty_driver under ppc. And I get a kernel panic. Can somebody explain me how finding the source of the error with a kernel panic trace : thanks Unable to handle kernel paging request for data at address 0x57f9 Faulting instruction address: 0xc0110ddc Oops: Kernel access of bad area, sig: 11 [#1] Modules linked in: NIP: c0110ddc LR: c08c CTR: REGS: cf01bcb0 TRAP: 0300 Not tainted (2.6.26) MSR: 9032 CR: 44002022 XER: 2000 DAR: 57f9, DSISR: 4000 TASK = cf01c000[1] 'swapper' THREAD: cf01a000 GPR00: 000c cf01bd60 cf01c000 cf04c300 cf01bdbc c01d GPR08: 1249 fffc cf000420 84002022 1b00 007fff00 GPR16: 0fffa1d0 0004 cf01bdbc 007ffec0 0080 GPR24: c01b7650 0002 c01d ce4a6700 cf04c300 5741 NIP [c0110ddc] init_dev+0x2bc/0x584 LR [c08c] tty_open+0xe8/0x3e0 Call Trace: [cf01bd60] [cf01bd78] 0xcf01bd78 (unreliable) [cf01bdb0] [c08c] tty_open+0xe8/0x3e0 [cf01bde0] [c00742c8] chrdev_open+0x114/0x1b0 [cf01be10] [c006fb5c] __dentry_open+0x190/0x2e8 [cf01be40] [c006fdac] nameidata_to_filp+0x38/0x70 [cf01be60] [c007bc60] do_filp_open+0x200/0x7d0 [cf01bf10] [c00700b4] do_sys_open+0x74/0x114 [cf01bf40] [c0003c94] init_post+0x34/0x258 [cf01bf60] [c019ca64] kernel_init+0x258/0x270 [cf01bff0] [c0011b3c] kernel_thread+0x44/0x60 Instruction dump: 7d808120 4e800020 7c832378 4bfa9ea9 7c7f1b79 418201f0 a81e0062 2f81 409efd98 83ff00d0 2c1f 4182fd90 <801f00b8> 70090080 408201b0 801e0060 ---[ end trace b7795a387aeb7786 ]--- Kernel panic - not syncing: Attempted to kill init! allocation failed: out of vmalloc space - use vmalloc= to increase size. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
RE: Trace
The instruction that caused the fault is at this address: > NIP [c0110ddc] init_dev+0x2bc/0x584 The hex value of the instruction is also highlighted between <> here: > Instruction dump: > 7d808120 4e800020 7c832378 4bfa9ea9 7c7f1b79 418201f0 a81e0062 2f81 > 409efd98 83ff00d0 2c1f 4182fd90 <801f00b8> 70090080 408201b0 801e0060 Disassemble your kernel and look at offset 0x2BC relative to the label init_dev From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sébastien Chrétien Sent: 01 September 2008 10:16 To: linuxppc-dev@ozlabs.org Subject: Trace Hello, I am triying to write a tty_driver under ppc. And I get a kernel panic. Can somebody explain me how finding the source of the error with a kernel panic trace : thanks Unable to handle kernel paging request for data at address 0x57f9 Faulting instruction address: 0xc0110ddc Oops: Kernel access of bad area, sig: 11 [#1] Modules linked in: NIP: c0110ddc LR: c08c CTR: REGS: cf01bcb0 TRAP: 0300 Not tainted (2.6.26) MSR: 9032 CR: 44002022 XER: 2000 DAR: 57f9, DSISR: 4000 TASK = cf01c000[1] 'swapper' THREAD: cf01a000 GPR00: 000c cf01bd60 cf01c000 cf04c300 cf01bdbc c01d GPR08: 1249 fffc cf000420 84002022 1b00 007fff00 GPR16: 0fffa1d0 0004 cf01bdbc 007ffec0 0080 GPR24: c01b7650 0002 c01d ce4a6700 cf04c300 5741 NIP [c0110ddc] init_dev+0x2bc/0x584 LR [c08c] tty_open+0xe8/0x3e0 Call Trace: [cf01bd60] [cf01bd78] 0xcf01bd78 (unreliable) [cf01bdb0] [c08c] tty_open+0xe8/0x3e0 [cf01bde0] [c00742c8] chrdev_open+0x114/0x1b0 [cf01be10] [c006fb5c] __dentry_open+0x190/0x2e8 [cf01be40] [c006fdac] nameidata_to_filp+0x38/0x70 [cf01be60] [c007bc60] do_filp_open+0x200/0x7d0 [cf01bf10] [c00700b4] do_sys_open+0x74/0x114 [cf01bf40] [c0003c94] init_post+0x34/0x258 [cf01bf60] [c019ca64] kernel_init+0x258/0x270 [cf01bff0] [c0011b3c] kernel_thread+0x44/0x60 Instruction dump: 7d808120 4e800020 7c832378 4bfa9ea9 7c7f1b79 418201f0 a81e0062 2f81 409efd98 83ff00d0 2c1f 4182fd90 <801f00b8> 70090080 408201b0 801e0060 ---[ end trace b7795a387aeb7786 ]--- Kernel panic - not syncing: Attempted to kill init! allocation failed: out of vmalloc space - use vmalloc= to increase size. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
RE: How to write a device driver in such a fashion .????
> On Initiation by the application of which key is pressed > driver should perform the task accordingly. There are 7 > keys so seven different task the driver will perform. This is not clear to me. > 1 . I do not want to use any entry point such as > read/write/ioctl. In such a case how to access the driver. > 2. We dont want to implement this as a chracrter driver. > 3. The driver shall look pretty much like an application > where in asscssing the H/W memory map . > > Hence no entry point and no registeration but an > application could be able to communicate I think you want the application to directly access memory-mapped hardware. For this you will need to open /dev/mem and use the mmap() system call to get a virtual address of your h/w. Clive ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev