Re: Problem Ethernet Initialization MPC5200 + LXT971A
Hi Tiejun tiejun.chen wrote: Stefan Strobl wrote: To workaround I could make u-boot run eth_init() always but that doesn't seem the right approach to this. Yes. Often we shouldn't depend the bootloader do this when we use NIC. But its worth tracking eth_init in detail to check what are missed for Linux. I guest those should be dedicated to the hardware. For example, configuring multiplex-pin, or reset PHY before the real operation action and so on. You're right! It was a wrong Port Multiplex Configuration. I think it's fair to expect the bootloader to do that bit of setup, since it's very hardware dependent. All I did was to adapt my CONFIG_SYS_GPS_PORT_CONFIG in u-boot. Many thanks Stefan. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Problem Ethernet Initialization MPC5200 + LXT971A
Hi I'm having a Problem with the Initialization of my Ethernet PHY (FEC_MPC5200 + LXT971A Phy). I'm using latest U-Boot and Linux 2.6.37 from Denx. Once in Linux I can ping my own IP-Address but not any other device in my network. The Link LED is on when connected to the network but when pinging some other device nothing is being transmitted (Traffic LED is off). If - before booting - I'm using any network command under U-Boot (which is calling eth_init()), the interface works fine after that under Linux also! In that case the kernel prints the line: PHY: f003000:00 - Link is Up - 100/Full So I'm not sure whether the Linux driver does not initialize the PHY correctly or whether I should be running a command under Linux that makes the interface work. I've played around with ifconfig but that didn't get me any further. Under sysfs I can see that the MAC address is assigned correctly but: carrier = 0 (should be 1) duplex = half (should be full) operstate = down speed = 10 (should be 100) To workaround I could make u-boot run eth_init() always but that doesn't seem the right approach to this. Any ideas? Many Thanks, Stefan. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
ethernet phy attached to wrong driver
Hi I'm having trouble with my Ethernet device on a TQM5200 based board with LXT971 Phy. I'm running U-Boot 2009.03 and a Kernel 2.6.30. When doing a ping under U-Boot before booting into Linux, Ethernet works fine in Linux also. Dmesg reads: [ 262.369444] net eth0: Using PHY at MDIO address 0 [ 263.265903] net eth0: attached phy 0 to driver LXT971 But if I start Linux without prior use of the fec under U-Boot, Ethernet is not working in Linux. The wrong drivers seems to be attached to the phy. Dmesg reads: [2.068285] net eth0: Using PHY at MDIO address 0 [2.964774] net eth0: attached phy 0 to driver Generic PHY ^^^ Is there a bootarg to tell linux which driver to use? Any ideas what I'm doing wrong? Regards Stefan. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: MPC52xx simple GPIO support
Anton Vorontsov wrote: Hi Stefan, On Tue, Jun 02, 2009 at 07:02:25PM +0200, Stefan Strobl wrote: Hi I still don't quite understand how to use the Flattened Device Tree / Open Firmware. I see there's a driver (mpc52xx_gpt.c) that supports to use the Pins on the GPT as simple GPIOs. I can see the appropriate entries in sysfs (/sys/devices/f000.soc5200/f620.timer), but how can I actually use these GPIO's now? For in-kernel usage example you can take a look at: arch/powerpc/boot/dts/mpc836x_rdk.dts (upm node, notice gpios = ) drivers/mtd/nand/fsl_upm.c (of_get_gpio() then gpio_request()). For userland usage you need to enable CONFIG_GPIO_SYSFS, and then look into /sys/class/gpio/{gpiochip,export,gpioNNN}. Thanks. With CONFIG_GPIO_SYSFS I can see the gpios as you mentioned, but cannot change its state there. I've now also added CONFIG_LEDS_GPIO and was able to connect the GPIOs to LEDs like this: gpt2: ti...@620 { compatible = fsl,mpc5200b-gpt-gpio,fsl,mpc5200-gpt-gpio; reg = 0x620 0x10; interrupts = 1 11 0; gpio-controller; #gpio-cells = 2; }; leds { compatible = gpio-leds; dbg { label = DbgLED; gpios = gpt2 0 1; /* Active low */ linux,default-trigger = heartbeat; }; }; I can now manipulate the state of the LED in /sys/class/led/DbgLED/, which is cool. The led class provides support for setting the brightness, which obviously the gpio driver doesn't support. The hardware (mpc52xx_gpt) would support it in PWM mode though. I'm now wandering how this could be best implemented. 1) - Create some PWM class similar to the GPIO class - Add support for PWM mode in mpc52xx_gpt.c that uses that PWM class - And add an interface for the LED to use the PWM class 2) - Create an LED driver that accesses the mpc52xx_gpt directly. I think I would be overwhelmed trying to implement (1) but am confident to do (2). What do you think is the right approach? Cheers, Stefan. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
How to add i2c platform data in dts file
Hi I'm using the i2c/chips/tsl2550 driver. In the tsl2550_probe() function the driver checks for platform data to set the operating_mode. I suppose I can provide this data in my dts file but I don't know how to do that. Currently my dts looks like this: tsl2...@39 { compatible = taos,tsl2550; reg = 0x39; }; Can anyone help me on how to set the operating_mode here? Thanks, Stefan. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
MPC52xx simple GPIO support
Hi I still don't quite understand how to use the Flattened Device Tree / Open Firmware. I see there's a driver (mpc52xx_gpt.c) that supports to use the Pins on the GPT as simple GPIOs. I activated it by adding these lines to my dts file: gpt2: ti...@620 { compatible = fsl,mpc5200b-gpt-gpio,fsl,mpc5200-gpt-gpio; reg = 0x620 0x10; interrupts = 1 11 0; gpio-controller; #gpio-cells = 2; }; I can see the appropriate entries in sysfs (/sys/devices/f000.soc5200/f620.timer), but how can I actually use these GPIO's now? Many thanks Stefan. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
ADS5121 problem using audio interface
Hi I'm trying to get the audio interface working on my ADS5121 Rev4.0 and have some questions. I did manage to record and play audio files of type raw and format S32_BE like this: $ arecord -traw -c2 -fS32_BE -Dhw:0,0 testfile $ aplay -traw -c2 -fS32_BE -Dhw:0,0 testfile I am not able to get the auto conversion work, so that I could play a wav file of any format. I'm getting this error: $ aplay -Dplughw:0,0 test.wav Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono ALSA lib pcm_plug.c:773:(snd_pcm_plug_hw_refine_schange) Unable to find an usable access for 'plughw:0,0' aplay: set_params:901: Sample format non available I'm not sure, but I expect this to be a problem of my ALSA configuration and this is where I'm stuck. Does anyone have a working ALSA configuration file for the ads5121? Or any other hints on how to overcome this problem? Does anyone know how to convert wav files so that they can be played in raw mode? Many thanks Stefan. - These are the steps I performed to get audio work: I'm using kernel 2.6.24.6 (linux-2.6-denx.git/ads5121) with ALSA-1.0.15 built into the kernel and ELDK-4.2. 1. Build and install alsa-lib-1.0.15 and alsa-utils-1.0.15 natively on the target. $ wget ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.0.15.tar.bz2 $ tar xf alsa-lib-1.0.15.tar.bz2 $ cd alsa-lib-1.0.15 $ ./configure $ make $ make install $ wget ftp://ftp.alsa-project.org/pub/utils/alsa-utils-1.0.15.tar.bz2 $ tar xf alsa-utils-1.0.15.tar.bz2 $ cd alsa-utils-1.0.15 $ ./configure --disable-nls $ make $ make install 2. Manually create the device nodes, with Minor numbers according to output from /proc/asound/devices $ cat /proc/asound/devices 0: [ 0] : control 1:: sequencer 16: [ 0- 0]: digital audio playback 24: [ 0- 0]: digital audio capture 33:: timer $ mkdir /dev/snd $ mknod /dev/snd/pcmC0D0p c 116 16 $ mknod /dev/snd/pcmC0D0c c 116 24 $ mknod /dev/snd/controlC0 c 116 0 $ mknod /dev/snd/timer c 116 33 $ mknod /dev/snd/seq c 116 1 3. Run aplay... $ aplay -l List of PLAYBACK Hardware Devices card 0: ADS [MPC5121 ADS], device 0: AC97 AC97 HiFi-NULL-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 $ aplay -L default:CARD=ADS MPC5121 ADS, Default Audio Device null Discard all samples (playback) or generate zero samples (capture) $ aplay -traw -c2 -fS32_BE -Dhw:0,0 /dev/urandom $ arecord -traw -c2 -fS32_BE -Dhw:0,0 testfile $ aplay -traw -c2 -fS32_BE -Dhw:0,0 testfile ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
ADS5121 how to use /dev/ttyPSC
Hi I'm new to Kernel 2.6 and OF. I'm using a ADS5121 board with kernel from denx (ads5121 branch from linux-2.6-denx). According to my dts file both PSC3 and PSC4 should be accessible through /dev/ttyPSC0 and /dev/ttyPSC1 respectively. When I simply try to run: $ echo Hello /dev/ttyPSC* I can't see any data coming out from the ports. And when trying to initialize the ports using termios commands I'm getting the Error Inappropriate ioctl for device. I'm not even getting a negative voltage on the TX Pin (idle state). But I can see the driver ttyPSC with major 204 in /proc/devices and I can also open the device successfully. I am also able to configure either port as CONSOLE in U-Boot so the Hardware is ok. Any ideas? Many thanks, Stefan ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev