Modify

Opened 11 years ago

Closed 10 years ago

Last modified 4 years ago

#1861 closed enhancement (fixed)

Atheros AR531X using Linux GPIO conventions

Reported by: Othello Owned by: developers
Priority: low Milestone: Barrier Breaker 14.07
Component: kernel Version:
Keywords: gpio atheros Cc:

Description

Dear All,

I'm pleased to announce a set of "patches" which allow the Atheros AR531X to expose it's GPIOs according to the document in the kernel source tree at <linux source>Documentation/gpio.txt .

Support for gpio interrupts have also been included.

The "patch" , unfortunately, is just a set of files to replace the <buildroot>target/linux/atheros-2.6/files/{include,arch} directories, as I think the way I've arranged the files make more sense.

Unfortunately, I only have a demo kernel module called proc_gpio2 (based off proc_gpio) which uses the Linux GPIO conventions instead. I don't have any good application(s) to write to demo gpio interrupts. Maybe someone can write a "reset router config" kernel module when the reset button is held down long enough?

Thanks for looking!

Attachments (11)

atheros-2.6.target-files.tar.bz2 (20.2 KB) - added by Othello 11 years ago.
tarball of <buildroot>/target/linux/atheros-2.6/files/
proc_gpio2.tar.bz2 (2.5 KB) - added by Othello 11 years ago.
proc_gpio2 kernel module to test GPIO pins
atheros-2.6.patch (2.7 KB) - added by Othello 11 years ago.
Patch of the affect files. Does not include new files and moved files
atheros-2.6.2.patch (64.6 KB) - added by Othello 11 years ago.
Updated patch which includes all code changes, as requested
atheros-generic-gpio.patch (71.6 KB) - added by Axel Gembe 10 years ago.
Merge the original patch with the latest trunk
atheros-register-gpiodev-2.patch (847 bytes) - added by Axel Gembe 10 years ago.
Make Atheros platform register a GPIO character device
gpioctl-for-atheros.patch (470 bytes) - added by Axel Gembe 10 years ago.
Make gpioctl selectable on Atheros
01-atheros-move-headers.patch (4.4 KB) - added by Axel Gembe 10 years ago.
This moves the Atheros headers from arch to include where include files belong
02-atheros-generic-gpio.patch (22.2 KB) - added by Axel Gembe 10 years ago.
This patch adds generic GPIO for Atheros
03-atheros-gpiodev.patch (1.6 KB) - added by Axel Gembe 10 years ago.
This patch adds a GPIODEV device on Atheros
04-gpioctl-for-atheros.patch (520 bytes) - added by Axel Gembe 10 years ago.
This patch makes gpioctl buildable on Atheros

Download all attachments as: .zip

Change History (32)

Changed 11 years ago by Othello

tarball of <buildroot>/target/linux/atheros-2.6/files/

Changed 11 years ago by Othello

proc_gpio2 kernel module to test GPIO pins

Changed 11 years ago by Othello

Patch of the affect files. Does not include new files and moved files

Changed 11 years ago by Othello

Updated patch which includes all code changes, as requested

comment:1 Changed 10 years ago by michu-at-neophob-com

will this patch applied to the trunk?

comment:2 Changed 10 years ago by blogic

  • Resolution set to wontfix
  • Status changed from new to closed

sorry ... wont be applied

comment:3 Changed 10 years ago by florian

  • Resolution wontfix deleted
  • Status changed from closed to reopened

comment:4 Changed 10 years ago by florian

Patch seems good to me.

comment:5 Changed 10 years ago by anonymous

perhaps also this patches could be applied: #2855. #2761 contains also a gpio module..

comment:6 Changed 10 years ago by gabesk@…

why won't it be applied?

comment:7 Changed 10 years ago by florian

It will be applied, there was a mistake in the understanding of this patch.

comment:8 Changed 10 years ago by anonymous

Any news regarding this patch ? I'm currently trying to integrate it into the latest trunk (while changing as few things as possible), but I'm still working on it.

comment:9 Changed 10 years ago by anonymous

Seems like i got it to work with the latest trunk. I've also added GPIODEV for atheros and made gpioctl buildable for Atheros.
While this is nice, I still had no lock with my MMC mod yet :\
I will cleanup the patch after a bit more testing and submit it here.

comment:10 Changed 10 years ago by anonymous

*luck :)

comment:11 Changed 10 years ago by anonymous

OK, I now have kmod-mmc-over-gpio working on Atheros (it didn't work the last time because I used a SD card which was faulty. Anyways, nice learning experience). I guess now its time to add a GPIO pin configuration mechanism to kmod-mmc-over-gpio... Will see what I can do after I submitted this patch. I still have the problem from #3273 which is why i cant directly install kmod-mmc-over-gpio (it always says it needs kmod-spi, etc...) What I done is to remove all the caps from SW1 as well as all pull-downs from SW1 at the underside of the board. I've also added a 9k pull-up resistor to 3.3V. I've noticed that the board seems to have problems with software reboot when you take 3.3V supply from SW1.3 instead of from the serial port. This is now La Fonera Monstruo :) It has a D-sub serial port, 2nd antenna, sd card slot while you almost don't notice its a hack from the outside...

comment:12 Changed 10 years ago by Axel Gembe

OK, here are the patches...

Changed 10 years ago by Axel Gembe

Merge the original patch with the latest trunk

Changed 10 years ago by Axel Gembe

Make Atheros platform register a GPIO character device

comment:13 Changed 10 years ago by Axel Gembe

Can a Ticket Admin remove atheros-register-gpiodev.patch ? It has a fragment from the other patch in it.

Changed 10 years ago by Axel Gembe

Make gpioctl selectable on Atheros

comment:14 Changed 10 years ago by Axel Gembe

Just noticed, this definitely doesn't belong into the patch:

//#define AR5315_GPIO_INT_M bla

I'll attach a patch without it.

comment:15 Changed 10 years ago by anonymous

OK, the patches don't apply without some manual SVN work:

svn mkdir target/linux/atheros/files/include/asm-mips/mach-atheros/ar5312
svn mkdir target/linux/atheros/files/include/asm-mips/mach-atheros/ar5315
svn cp target/linux/atheros/files/arch/mips/atheros/ar5312/ar5312.h target/linux/atheros/files/include/asm-mips/mach-atheros/ar5312/
svn cp target/linux/atheros/files/arch/mips/atheros/ar5315/ar5315.h target/linux/atheros/files/include/asm-mips/mach-atheros/ar5315/
svn cp target/linux/atheros/files/arch/mips/atheros/ar531x.h target/linux/atheros/files/include/asm-mips/mach-atheros/

I'm preparing a cleaner patch series I'll be posting soon.

Changed 10 years ago by Axel Gembe

This moves the Atheros headers from arch to include where include files belong

Changed 10 years ago by Axel Gembe

This patch adds generic GPIO for Atheros

Changed 10 years ago by Axel Gembe

This patch adds a GPIODEV device on Atheros

Changed 10 years ago by Axel Gembe

This patch makes gpioctl buildable on Atheros

comment:16 Changed 10 years ago by anonymous

All patches attached now, read the comments at the top of the first patch before applying!

comment:17 Changed 10 years ago by Axel Gembe

As a note: I still have restart problems on the La Fonera which I think are related to the GPIO patch (I didn't test it without it yet, but it worked recently). The serial output says that the box is being restarted, but not even RedBoot appears after that. I need to power cycle the box to use it again. As a workaround for restarting the box you can use this:

gpioctl dirout 5 # Set reset GPIO pin as output

It would be nice if someone could confirm this behaviour on his Fonera to make sure it's not some sideeffect from the mods I used.

comment:18 Changed 10 years ago by blogic

  • Resolution set to fixed
  • Status changed from reopened to closed

fixed in [10724], thanks Othello

comment:19 Changed 10 years ago by anonymous

i'm trying revision 12065 with 2.6.25.1 kernel. i've removed the request_irq from arch/mips/atheros/reset.c but it is still restarting with followin message

Freeing unused kernel memory: 132k freed
Please be patient, while OpenWrt loads ...
Algorithmics/MIPS FPU Emulator v1.5
- preinit -

- init -

Please press Enter to activate this console.

BusyBox v1.8.2 (2008-07-28 18:45:16 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (bleeding edge, r12049) -------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@(none):/#
root@(none):/#
root@(none):/#
root@(none):/#
root@(none):/# ps
  PID  Uid        VSZ Stat Command
    1 root       2416 S   init
    2 root            SW< [kthreadd]
    3 root            SW< [ksoftirqd/0]
    4 root            SW< [events/0]
    5 root      device eth0 entered promiscuous mode
      SW< [khelper]
   25 root            SW< [kblockd/0]
   55 root            SW  [pdflush]
   56 root     br-lan: port 1(eth0) entering learning state
       SW  [pdflbr-lan: topology change detected, propagating
ush]
   57 rootbr-lan: port 1(eth0) entering forwarding state
            SW< [kswapd0]
   58 root            SW< [aio/0]
   74 root            SW< [mtdblockd]
  208 root            RWN [jffs2_gcd_mtd1]
  213 root       2416 S   /bin/sh /etc/init.d/rcS S boot
  214 root       2448 S   /bin/sh /etc/rc.common /etc/rc.d/S10boot boot
  215 root       2416 S   logger -s -p 6 -t
  216 root       2420 S   /bin/ash --login
  225 root       2428 S   syslogd -C16
  227 root       2408 S   klogd
  237 root       1128 S   /sbin/hotplug2 --override --persistent --max-children
  262 root       2440 S   /bin/sh /sbin/hotplug-call net
  270 root       2472 R   /bin/sh /sbin/hotplug-call net
  285 root       2416 R   ps
  286 root             []
root@(none):/# PPP generic driver version 2.4.2

root@(none):/#
root@(none):/# wlan: trunk
ath_hal: module license 'Proprietary' taints kernel.
ath_hal: 0.10.5.6 (AR5212, AR5312, RF5111, RF5112, RF2316, RF2317, TX_DESC_SWAP)

root@(none):/# ath_rate_minstrel: Minstrel automatic rate control algorithm 1.2 (trunk)
ath_rate_minstrel: look around rate set to 10%
ath_rate_minstrel: EWMA rolloff level set to 75%
ath_rate_minstrel: max segment size in the mrr set to 6000 us
wlan: mac acl policy registered
ath_ahb: trunk
wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/W encryption support: WEP AES AES_CCM TKIP
ath_ahb: wifi0: Atheros 2315 WiSoC: mem=0xb0000000, irq=3

root@(none):/#
root@(none):/#
root@(none):/# ps
  PID  Uid        VSZ Stat Command
    1 root       2416 S   init
    2 root            SW< [kthreadd]
    3 root            SW< [ksoftirqd/0]
    4 root            SW< [events/0]
    5 root            SW< [khelper]
   25 root            SW< [kblockd/0]
   55 root            SW  [pdflush]
   56 root            SW  [pdflush]
   57 root            SW< [kswapd0]
   58 root            SW< [aio/0]
   74 root            SW< [mtdblockd]
  208 root            SWN [jffs2_gcd_mtd1]
  213 root       2416 S   /bin/sh /etc/init.d/rcS S boot
  215 root       2416 S   logger -s -p 6 -t
  216 root       2420 S   /bin/ash --login
  225 root       2428 S   syslogd -C16
  227 root       2408 S   klogd
  237 root       1132 S   /sbin/hotplug2 --override --persistent --max-children
  382 root            SW< [kmmcd]
  411 root       2472 S   /bin/sh /etc/rc.common /etc/rc.d/S40network boot
  413 root       2492 S   /bin/sh /sbin/wifi up
  427 root       2492 S   /bin/sh /sbin/wifi up
  428 root       2492 S   /bin/sh /sbin/wifi up
  431 root       2416 R   ps
  432 root       2412 R   pidof hostapd wpa_supplicant
root@(none):/#
root@(none):/#
root@(none):/#
root@(none):/# lgpio-mmc: Failed to request mmc_spi module.
+Ethernet eth0: MAC address 00:18:84:81:f8:a8
IP: 192.168.1.1/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.1.254

RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version V1.00 - built 10:37:27, Dec 12 2006

Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.

Board: FON1
RAM: 0x80000000-0x81000000, [0x80040aa0-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.

comment:20 Changed 9 years ago by anonymous

http://www.salewroughtiron.cn installing metal stair rails Interior stair handrail installing metal stair rails Interior stair handrail exterior baluster Glass wood stainless wrought CONTEMPORARY designs stairways aluminum modern log banister DECK outdoor price posts vinyl curved rails http://www.china-made-door.com.cn door gate http://www.beijing-door.cn wrought CONTEMPORARY designs stairways installing metal stair rails Interior stair handrail exterior baluster Glass wood stainless wrought CONTEMPORARY designs stairways aluminum modern log banister DECK outdoor price posts vinyl curved rails http://www.hebei-railings.cn aluminum modern log banister DECK outdoor price installing metal stair rails Interior stair handrail exterior baluster Glass wood stainless wrought CONTEMPORARY designs stairways aluminum modern log banister DECK outdoor price posts vinyl curved rails posts vinyl curved rails

comment:21 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.