Using GPIO
John Linn
John.Linn at xilinx.com
Sat May 17 02:17:10 EST 2008
Hi,
Dts files are not used with arch/ppc.
In arch/ppc, the drivers that are in the system depend on the
arch/ppc/platforms/4xx/xparameters/xparameters_ml405.h to setup the
addresses of the devices and their configuration.
I looked at the ML405 setup in the git tree and it appears that it would
need to be added to arch/ppc/syslib/virtex_devices.c. The platform data
in virtex_devices.c must include the GPIO for it to be probed correctly.
It should be easy for you to add the data to make it work.
I see a GPIO in the xparameters*.h for the LEDs.
Thanks,
John
-----Original Message-----
From: linuxppc-dev-bounces+john.linn=xilinx.com at ozlabs.org
[mailto:linuxppc-dev-bounces+john.linn=xilinx.com at ozlabs.org] On Behalf
Of Guillaume Dargaud
Sent: Friday, May 16, 2008 2:16 AM
To: linuxppc-dev at ozlabs.org
Subject: Re: Using GPIO
> If you're using arch/powerpc, my understanding is that
> CONFIG_XILINX_GPIO needs to be enabled as well as having the right
info
> in the dts file.
I'm using arch/ppc, so excuse my ignorance but what are dts files ?
I see arch/powerpc/boot/dts/ml405.dts in the kernel tree which would
need
some changes, but it looks like a generated file. Generated by what ?
> If you're using arch/ppc, I believe you just need CONFIG_XILINX_GPIO
> enabled.
> When the system boots up, you see a message on the console when the
GPIO
> driver initializes.
That's what I'm trying to use, but there's no gpio info in the messages.
Here's a copy:
Linux version 2.6.25-rc9 (someone at somewhere.in.summertime) (gcc version
4.1.2) #27 Thu May 15 18:40:17 CEST 2008
Xilinx Generic PowerPC board support package (Xilinx ML405) (Virtex-4
FX)
Entering add_active_range(0, 0, 32768) 0 entries of 256 used
Zone PFN ranges:
DMA 0 -> 32768
Normal 32768 -> 32768
Movable zone start PFN for each node
active PFN ranges
0: 0 -> 32768
On node 0 totalpages: 32768
DMA zone: 256 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 32512 pages, LIFO batch:7
Normal zone: 0 pages used for memmap
Movable zone: 0 pages used for memmap
Built 1 zonelists in Zone order, mobility grouping on. Total pages:
32512
Kernel command line: console=ttyUL0,115200 rw root=/dev/nfs ip=bootp
Xilinx INTC #0 at 0x81800000 mapped to 0xFDFFF000
PID hash table entries: 512 (order: 9, 2048 bytes)
Console: colour dummy device 80x25
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 127872k available (1516k kernel code, 460k data, 80k init, 0k
highmem)
Calibrating delay loop... 298.40 BogoMIPS (lpj=496640)
Mount-cache hash table entries: 512
net_namespace: 152 bytes
NET: Registered protocol family 16
Registering device uartlite:0
Registering device xsysace:0
Fixup MAC address for xilinx_lltemac:0
Registering device xilinx_lltemac:0
Registering device xilinx_iic:0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
io scheduler noop registered (default)
uartlite.0: ttyUL0 at MMIO 0x84000003 (irq = 8) is a uartlite
enabled
loop: module loaded
xsysace xsa: Xilinx SystemACE revision 1.0.12
xsysace xsa: capacity: 1014048 sectors
xsa: xsa1 xsa2
Xilinx SystemACE device driver, major=254
xilinx_lltemac xilinx_lltemac.0: MAC address is now 0: a:35: 1: 2: 3
xilinx_lltemac xilinx_lltemac.0: XLlTemac: using DMA mode.
XLlTemac: Dma base address: phy: 0x84600100, virt: 0xc9008100
XLlTemac: buffer descriptor size: 32768 (0x8000)
XLlTemac: Allocating DMA descriptors with kmalloc<6>XLlTemac:
(buffer_descriptor_init) phy: 0x7ca8000, virt: 0xc7ca8000, size: 0x8000
XTemac: PHY detected at address 7.
eth0: Dropping NETIF_F_SG since no checksum feature.
xilinx_lltemac xilinx_lltemac.0: eth0: Xilinx TEMAC at 0x81C00000 mapped
to
0xC9004000, irq=2
mice: PS/2 mouse device common for all mice
xilinx_iic.0 #0 at 0x81600000 mapped to 0xC9020000, irq=4
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
eth0: XLlTemac: Options: 0x3fa
eth0: XLlTemac: allocating interrupt 0 for dma mode tx.
eth0: XLlTemac: allocating interrupt 1 for dma mode rx.
eth0: XLlTemac: speed set to 100Mb/s
eth0: XLlTemac: Send Threshold = 24, Receive Threshold = 4
eth0: XLlTemac: Send Wait bound = 254, Receive Wait bound = 254
Sending BOOTP requests . OK
IP-Config: Got BOOTP answer from 192.168.1.185, my address is
192.168.1.200
IP-Config: Complete:
device=eth0, addr=192.168.1.200, mask=255.255.255.0,
gw=192.168.1.185,
host=genepy, domain=, nis-domain=(none),
bootserver=192.168.1.185, rootserver=192.168.1.185,
rootpath=/media/rootfs
Looking up port of RPC 100003/2 on 192.168.1.185
Looking up port of RPC 100005/1 on 192.168.1.185
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 80k init
...and the boot proceeds fine.
And a cleaned-up .config:
CONFIG_WORD_SIZE=32
CONFIG_MMU=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_ARCH_HAS_ILOG2_U32=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_PPC=y
CONFIG_PPC32=y
CONFIG_GENERIC_NVRAM=y
CONFIG_GENERIC_FIND_NEXT_BIT=y
CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_GENERIC_BUG=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_EXPERIMENTAL=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
CONFIG_LOG_BUF_SHIFT=14
CONFIG_NAMESPACES=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_COMPAT_BRK=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_ANON_INODES=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_SLAB=y
CONFIG_HAVE_OPROFILE=y
CONFIG_HAVE_KPROBES=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_BLOCK=y
CONFIG_IOSCHED_NOOP=y
CONFIG_DEFAULT_NOOP=y
CONFIG_DEFAULT_IOSCHED="noop"
CONFIG_CLASSIC_RCU=y
CONFIG_40x=y
CONFIG_PPC_DCR_NATIVE=y
CONFIG_PPC_DCR=y
CONFIG_KEXEC=y
CONFIG_4xx=y
CONFIG_XILINX_ML405=y
CONFIG_IBM405_ERR77=y
CONFIG_IBM405_ERR51=y
CONFIG_XILINX_MLxxx=y
CONFIG_XILINX_VIRTEX_4_FX=y
CONFIG_XILINX_VIRTEX=y
CONFIG_XILINX_EMBED_CONFIG=y
CONFIG_EMBEDDEDBOOT=y
CONFIG_PPC_GEN550=y
CONFIG_UART0_TTYS0=y
CONFIG_NOT_COHERENT_CACHE=y
CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_HZ_300=y
CONFIG_HZ=300
CONFIG_PREEMPT_VOLUNTARY=y
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_ZONE_DMA_FLAG=1
CONFIG_BOUNCE=y
CONFIG_VIRT_TO_BUS=y
CONFIG_BINFMT_ELF=y
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="console=ttyUL0,115200 rw root=/dev/nfs ip=bootp"
CONFIG_ISA_DMA_API=y
CONFIG_ZONE_DMA=y
CONFIG_HIGHMEM_START=0xfe000000
CONFIG_LOWMEM_SIZE=0x30000000
CONFIG_KERNEL_START=0xc0000000
CONFIG_TASK_SIZE=0x80000000
CONFIG_CONSISTENT_START=0xff100000
CONFIG_CONSISTENT_SIZE=0x00200000
CONFIG_BOOT_LOAD=0x00400000
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_PACKET_MMAP=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_FIB_HASH=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_BLK_DEV=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_XILINX_SYSACE=y
CONFIG_XILINX_DRIVERS=y
CONFIG_NEED_XILINX_LLDMA=y
CONFIG_HAVE_IDE=y
CONFIG_NETDEVICES=y
CONFIG_NETDEV_1000=y
CONFIG_XILINX_LLTEMAC=y
CONFIG_XILINX_LLTEMAC_MARVELL_88E1111_GMII=y
CONFIG_INPUT=y
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
CONFIG_SERIAL_UARTLITE=y
CONFIG_SERIAL_UARTLITE_CONSOLE=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_XILINX_GPIO=y
CONFIG_XILINX_HWICAP=y
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_XILINX_IIC=y
CONFIG_SSB_POSSIBLE=y
CONFIG_DUMMY_CONSOLE=y
CONFIG_XILINX_EDK=y
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_SYSFS=y
CONFIG_CONFIGFS_FS=y
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_ROOT_NFS=y
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
CONFIG_MSDOS_PARTITION=y
CONFIG_PLIST=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_PRINTK_TIME=y
CONFIG_ENABLE_WARN_DEPRECATED=y
CONFIG_ENABLE_MUST_CHECK=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DETECT_SOFTLOCKUP=y
CONFIG_SCHED_DEBUG=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_INFO=y
--
Guillaume Dargaud
http://www.gdargaud.net/
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev at ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
More information about the Linuxppc-dev
mailing list