Changeset 20418
- Timestamp:
- 2010-03-25T12:50:46+01:00 (8 years ago)
- Location:
- trunk/target/linux/ifxmips
- Files:
-
- 2 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/target/linux/ifxmips/config-2.6.30
r20136 r20418 5 5 # CONFIG_ARCH_HAS_ILOG2_U64 is not set 6 6 CONFIG_ARCH_POPULATES_NODE_MAP=y 7 CONFIG_ARCH_REQUIRE_GPIOLIB=y 7 8 # CONFIG_ARCH_SUPPORTS_MSI is not set 8 9 CONFIG_ARCH_SUPPORTS_OPROFILE=y 9 10 CONFIG_ARCH_SUSPEND_POSSIBLE=y 10 CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y11 11 # CONFIG_BCM47XX is not set 12 12 # CONFIG_BINARY_PRINTF is not set … … 14 14 # CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set 15 15 # CONFIG_CAVIUM_OCTEON_SIMULATOR is not set 16 CONFIG_CEVT_R4K=y 16 17 CONFIG_CEVT_R4K_LIB=y 17 CONFIG_CEVT_R4K=y18 18 CONFIG_CMDLINE="console=ttyS0,9600 rootfstype=squashfs,jffs2" 19 19 CONFIG_CPU_BIG_ENDIAN=y … … 24 24 # CONFIG_CPU_LITTLE_ENDIAN is not set 25 25 # CONFIG_CPU_LOONGSON2 is not set 26 CONFIG_CPU_MIPS32=y 26 27 # CONFIG_CPU_MIPS32_R1 is not set 27 28 CONFIG_CPU_MIPS32_R2=y 28 CONFIG_CPU_MIPS32=y29 29 # CONFIG_CPU_MIPS64_R1 is not set 30 30 # CONFIG_CPU_MIPS64_R2 is not set … … 48 48 # CONFIG_CPU_TX49XX is not set 49 49 # CONFIG_CPU_VR41XX is not set 50 CONFIG_CSRC_R4K=y 50 51 CONFIG_CSRC_R4K_LIB=y 51 CONFIG_CSRC_R4K=y52 52 CONFIG_DECOMPRESS_LZMA=y 53 53 CONFIG_DEVPORT=y … … 56 56 CONFIG_DMA_NONCOHERENT=y 57 57 CONFIG_EARLY_PRINTK=y 58 CONFIG_GENERIC_CLOCKEVENTS=y 58 59 CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 59 CONFIG_GENERIC_CLOCKEVENTS=y60 60 CONFIG_GENERIC_CMOS_UPDATE=y 61 61 CONFIG_GENERIC_FIND_LAST_BIT=y … … 63 63 CONFIG_GENERIC_GPIO=y 64 64 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 65 CONFIG_GPIOLIB=y 66 CONFIG_GPIO_IFXMIPS_EBU=y 67 CONFIG_GPIO_SYSFS=y 65 68 CONFIG_HARDWARE_WATCHPOINTS=y 66 69 CONFIG_HAS_DMA=y … … 76 79 CONFIG_HW_HAS_PCI=y 77 80 CONFIG_HW_RANDOM=y 81 CONFIG_HZ=250 78 82 # CONFIG_HZ_100 is not set 79 CONFIG_HZ=25080 83 CONFIG_HZ_250=y 84 CONFIG_IFXMIPS=y 81 85 CONFIG_IFXMIPS_GPIO_RST_BTN=y 82 86 CONFIG_IFXMIPS_MII0=y … … 84 88 CONFIG_IFXMIPS_PROM_ASC1=y 85 89 CONFIG_IFXMIPS_WDT=y 86 CONFIG_IFXMIPS=y87 90 CONFIG_INITRAMFS_SOURCE="" 88 91 CONFIG_IRQ_CPU=y … … 98 101 # CONFIG_MACH_VR41XX is not set 99 102 # CONFIG_MIKROTIK_RB532 is not set 103 CONFIG_MIPS=y 100 104 # CONFIG_MIPS_COBALT is not set 101 105 CONFIG_MIPS_L1_CACHE_SHIFT=5 … … 107 111 # CONFIG_MIPS_SIM is not set 108 112 # CONFIG_MIPS_VPE_LOADER is not set 109 CONFIG_MIPS=y110 113 CONFIG_MTD_CFI_ADV_OPTIONS=y 111 114 CONFIG_MTD_CFI_GEOMETRY=y 112 # CONFIG_MTD_CFI_INTELEXT is not set113 115 CONFIG_MTD_CMDLINE_PARTS=y 114 116 CONFIG_MTD_IFXMIPS=y … … 127 129 # CONFIG_PNX8550_STB810 is not set 128 130 # CONFIG_PROBE_INITRD_HEADER is not set 131 CONFIG_RTL8306_PHY=y 129 132 CONFIG_SCHED_OMIT_FRAME_POINTER=y 130 133 # CONFIG_SCSI_DMA is not set … … 144 147 # CONFIG_SIBYTE_SWARM is not set 145 148 # CONFIG_SLOW_WORK is not set 146 CONFIG_SQUASHFS_SUPPORT_LZMA=y147 149 CONFIG_SWAP_IO_SPACE=y 148 150 CONFIG_SWCONFIG=y -
trunk/target/linux/ifxmips/files/arch/mips/ifxmips/gpio.c
r18010 r20418 37 37 #include <linux/uaccess.h> 38 38 #include <linux/semaphore.h> 39 #include <linux/gpio.h> 39 40 40 41 #include <net/sock.h> … … 45 46 #define PINS_PER_PORT 16 46 47 47 #ifdef CONFIG_IFXMIPS_GPIO_RST_BTN48 49 unsigned int rst_port = 1;50 unsigned int rst_pin = 15;51 static struct timer_list rst_button_timer;52 53 extern struct sock *uevent_sock;54 extern u64 uevent_next_seqnum(void);55 static unsigned long seen;56 static int pressed;57 58 struct event_t {59 struct work_struct wq;60 int set;61 unsigned long jiffies;62 };63 #endif64 65 48 #define IFXMIPS_GPIO_SANITY {if (port > MAX_PORTS || pin > PINS_PER_PORT) return -EINVAL; } 66 49 67 int ifxmips_port_reserve_pin(unsigned int port, unsigned int pin) 50 #define GPIO_TO_PORT(x) ((x > 15) ? (1) : (0)) 51 #define GPIO_TO_GPIO(x) ((x > 15) ? (x - 16) : (x)) 52 53 int 54 ifxmips_port_reserve_pin(unsigned int port, unsigned int pin) 68 55 { 69 56 IFXMIPS_GPIO_SANITY; … … 73 60 EXPORT_SYMBOL(ifxmips_port_reserve_pin); 74 61 75 int ifxmips_port_free_pin(unsigned int port, unsigned int pin) 62 int 63 ifxmips_port_free_pin(unsigned int port, unsigned int pin) 76 64 { 77 65 IFXMIPS_GPIO_SANITY; … … 81 69 EXPORT_SYMBOL(ifxmips_port_free_pin); 82 70 83 int ifxmips_port_set_open_drain(unsigned int port, unsigned int pin) 71 int 72 ifxmips_port_set_open_drain(unsigned int port, unsigned int pin) 84 73 { 85 74 IFXMIPS_GPIO_SANITY; … … 90 79 EXPORT_SYMBOL(ifxmips_port_set_open_drain); 91 80 92 int ifxmips_port_clear_open_drain(unsigned int port, unsigned int pin) 81 int 82 ifxmips_port_clear_open_drain(unsigned int port, unsigned int pin) 93 83 { 94 84 IFXMIPS_GPIO_SANITY; … … 99 89 EXPORT_SYMBOL(ifxmips_port_clear_open_drain); 100 90 101 int ifxmips_port_set_pudsel(unsigned int port, unsigned int pin) 91 int 92 ifxmips_port_set_pudsel(unsigned int port, unsigned int pin) 102 93 { 103 94 IFXMIPS_GPIO_SANITY; … … 108 99 EXPORT_SYMBOL(ifxmips_port_set_pudsel); 109 100 110 int ifxmips_port_clear_pudsel(unsigned int port, unsigned int pin) 101 int 102 ifxmips_port_clear_pudsel(unsigned int port, unsigned int pin) 111 103 { 112 104 IFXMIPS_GPIO_SANITY; … … 117 109 EXPORT_SYMBOL(ifxmips_port_clear_pudsel); 118 110 119 int ifxmips_port_set_puden(unsigned int port, unsigned int pin) 111 int 112 ifxmips_port_set_puden(unsigned int port, unsigned int pin) 120 113 { 121 114 IFXMIPS_GPIO_SANITY; … … 126 119 EXPORT_SYMBOL(ifxmips_port_set_puden); 127 120 128 int ifxmips_port_clear_puden(unsigned int port, unsigned int pin) 121 int 122 ifxmips_port_clear_puden(unsigned int port, unsigned int pin) 129 123 { 130 124 IFXMIPS_GPIO_SANITY; … … 135 129 EXPORT_SYMBOL(ifxmips_port_clear_puden); 136 130 137 int ifxmips_port_set_stoff(unsigned int port, unsigned int pin) 131 int 132 ifxmips_port_set_stoff(unsigned int port, unsigned int pin) 138 133 { 139 134 IFXMIPS_GPIO_SANITY; … … 144 139 EXPORT_SYMBOL(ifxmips_port_set_stoff); 145 140 146 int ifxmips_port_clear_stoff(unsigned int port, unsigned int pin) 141 int 142 ifxmips_port_clear_stoff(unsigned int port, unsigned int pin) 147 143 { 148 144 IFXMIPS_GPIO_SANITY; … … 153 149 EXPORT_SYMBOL(ifxmips_port_clear_stoff); 154 150 155 int ifxmips_port_set_dir_out(unsigned int port, unsigned int pin) 151 int 152 ifxmips_port_set_dir_out(unsigned int port, unsigned int pin) 156 153 { 157 154 IFXMIPS_GPIO_SANITY; … … 162 159 EXPORT_SYMBOL(ifxmips_port_set_dir_out); 163 160 164 int ifxmips_port_set_dir_in(unsigned int port, unsigned int pin) 161 int 162 ifxmips_port_set_dir_in(unsigned int port, unsigned int pin) 165 163 { 166 164 IFXMIPS_GPIO_SANITY; … … 171 169 EXPORT_SYMBOL(ifxmips_port_set_dir_in); 172 170 173 int ifxmips_port_set_output(unsigned int port, unsigned int pin) 171 int 172 ifxmips_port_set_output(unsigned int port, unsigned int pin) 174 173 { 175 174 IFXMIPS_GPIO_SANITY; … … 180 179 EXPORT_SYMBOL(ifxmips_port_set_output); 181 180 182 int ifxmips_port_clear_output(unsigned int port, unsigned int pin) 181 int 182 ifxmips_port_clear_output(unsigned int port, unsigned int pin) 183 183 { 184 184 IFXMIPS_GPIO_SANITY; … … 189 189 EXPORT_SYMBOL(ifxmips_port_clear_output); 190 190 191 int ifxmips_port_get_input(unsigned int port, unsigned int pin) 191 int 192 ifxmips_port_get_input(unsigned int port, unsigned int pin) 192 193 { 193 194 IFXMIPS_GPIO_SANITY; … … 199 200 EXPORT_SYMBOL(ifxmips_port_get_input); 200 201 201 int ifxmips_port_set_altsel0(unsigned int port, unsigned int pin) 202 int 203 ifxmips_port_set_altsel0(unsigned int port, unsigned int pin) 202 204 { 203 205 IFXMIPS_GPIO_SANITY; … … 208 210 EXPORT_SYMBOL(ifxmips_port_set_altsel0); 209 211 210 int ifxmips_port_clear_altsel0(unsigned int port, unsigned int pin) 212 int 213 ifxmips_port_clear_altsel0(unsigned int port, unsigned int pin) 211 214 { 212 215 IFXMIPS_GPIO_SANITY; … … 217 220 EXPORT_SYMBOL(ifxmips_port_clear_altsel0); 218 221 219 int ifxmips_port_set_altsel1(unsigned int port, unsigned int pin) 222 int 223 ifxmips_port_set_altsel1(unsigned int port, unsigned int pin) 220 224 { 221 225 IFXMIPS_GPIO_SANITY; … … 226 230 EXPORT_SYMBOL(ifxmips_port_set_altsel1); 227 231 228 int ifxmips_port_clear_altsel1(unsigned int port, unsigned int pin) 232 int 233 ifxmips_port_clear_altsel1(unsigned int port, unsigned int pin) 229 234 { 230 235 IFXMIPS_GPIO_SANITY; … … 235 240 EXPORT_SYMBOL(ifxmips_port_clear_altsel1); 236 241 237 #ifdef CONFIG_IFXMIPS_GPIO_RST_BTN 238 static inline void add_msg(struct sk_buff *skb, char *msg) 239 { 240 char *scratch; 241 scratch = skb_put(skb, strlen(msg) + 1); 242 sprintf(scratch, msg); 243 } 244 245 static void hotplug_button(struct work_struct *wq) 246 { 247 struct sk_buff *skb; 248 struct event_t *event; 249 size_t len; 250 char *scratch, *s; 251 char buf[128]; 252 253 event = container_of(wq, struct event_t, wq); 254 if (!uevent_sock) 255 goto done; 256 257 s = event->set ? "pressed" : "released"; 258 len = strlen(s) + 2; 259 skb = alloc_skb(len + 2048, GFP_KERNEL); 260 if (!skb) 261 goto done; 262 263 scratch = skb_put(skb, len); 264 sprintf(scratch, "%s@", s); 265 add_msg(skb, "HOME=/"); 266 add_msg(skb, "PATH=/sbin:/bin:/usr/sbin:/usr/bin"); 267 add_msg(skb, "SUBSYSTEM=button"); 268 add_msg(skb, "BUTTON=reset"); 269 add_msg(skb, (event->set ? "ACTION=pressed" : "ACTION=released")); 270 sprintf(buf, "SEEN=%ld", (event->jiffies - seen)/HZ); 271 add_msg(skb, buf); 272 snprintf(buf, 128, "SEQNUM=%llu", uevent_next_seqnum()); 273 add_msg(skb, buf); 274 275 NETLINK_CB(skb).dst_group = 1; 276 netlink_broadcast(uevent_sock, skb, 0, 1, GFP_KERNEL); 277 done: 278 kfree(event); 279 } 280 281 static void reset_button_poll(unsigned long unused) 282 { 283 struct event_t *event; 284 285 rst_button_timer.expires = jiffies + (HZ / 4); 286 add_timer(&rst_button_timer); 287 288 if (pressed != ifxmips_port_get_input(rst_port, rst_pin)) { 289 if (pressed) 290 pressed = 0; 291 else 292 pressed = 1; 293 event = kzalloc(sizeof(struct event_t), GFP_ATOMIC); 294 if (!event) { 295 printk(KERN_INFO "Could not alloc hotplug event\n"); 296 return; 297 } 298 event->set = pressed; 299 event->jiffies = jiffies; 300 INIT_WORK(&event->wq, (void *)(void *)hotplug_button); 301 schedule_work(&event->wq); 302 seen = jiffies; 303 } 304 } 305 #endif 306 307 static int ifxmips_gpio_probe(struct platform_device *dev) 308 { 309 int retval = 0; 310 311 #ifdef CONFIG_IFXMIPS_GPIO_RST_BTN 312 rst_port = dev->resource[0].start; 313 rst_pin = dev->resource[0].end; 314 ifxmips_port_set_open_drain(rst_port, rst_pin); 315 ifxmips_port_clear_altsel0(rst_port, rst_pin); 316 ifxmips_port_clear_altsel1(rst_port, rst_pin); 317 ifxmips_port_set_dir_in(rst_port, rst_pin); 318 seen = jiffies; 319 init_timer(&rst_button_timer); 320 rst_button_timer.function = reset_button_poll; 321 rst_button_timer.expires = jiffies + HZ; 322 add_timer(&rst_button_timer); 323 #endif 324 return retval; 325 } 326 327 static int ifxmips_gpio_remove(struct platform_device *pdev) 328 { 329 #ifdef CONFIG_IFXMIPS_GPIO_RST_BTN 330 del_timer_sync(&rst_button_timer); 331 #endif 332 return 0; 333 } 334 335 static struct platform_driver ifxmips_gpio_driver = { 242 static void 243 ifxmips_gpio_set(struct gpio_chip *chip, unsigned int offset, int value) 244 { 245 int port = GPIO_TO_PORT(offset); 246 int gpio = GPIO_TO_GPIO(offset); 247 if(value) 248 ifxmips_port_set_output(port, gpio); 249 else 250 ifxmips_port_clear_output(port, gpio); 251 } 252 253 static int 254 ifxmips_gpio_get(struct gpio_chip *chip, unsigned int offset) 255 { 256 int port = GPIO_TO_PORT(offset); 257 int gpio = GPIO_TO_GPIO(offset); 258 return ifxmips_port_get_input(port, gpio); 259 } 260 261 static int 262 ifxmips_gpio_direction_input(struct gpio_chip *chip, unsigned int offset) 263 { 264 int port = GPIO_TO_PORT(offset); 265 int gpio = GPIO_TO_GPIO(offset); 266 ifxmips_port_set_open_drain(port, gpio); 267 ifxmips_port_clear_altsel0(port, gpio); 268 ifxmips_port_clear_altsel1(port, gpio); 269 ifxmips_port_set_dir_in(port, gpio); 270 return 0; 271 } 272 273 static int 274 ifxmips_gpio_direction_output(struct gpio_chip *chip, unsigned int offset, int value) 275 { 276 int port = GPIO_TO_PORT(offset); 277 int gpio = GPIO_TO_GPIO(offset); 278 ifxmips_port_clear_open_drain(port, gpio); 279 ifxmips_port_clear_altsel0(port, gpio); 280 ifxmips_port_clear_altsel1(port, gpio); 281 ifxmips_port_set_dir_out(port, gpio); 282 ifxmips_gpio_set(chip, offset, value); 283 return 0; 284 } 285 286 int 287 gpio_to_irq(unsigned int gpio) 288 { 289 return -EINVAL; 290 } 291 EXPORT_SYMBOL(gpio_to_irq); 292 293 struct gpio_chip 294 ifxmips_gpio_chip = 295 { 296 .label = "ifxmips-gpio", 297 .direction_input = ifxmips_gpio_direction_input, 298 .direction_output = ifxmips_gpio_direction_output, 299 .get = ifxmips_gpio_get, 300 .set = ifxmips_gpio_set, 301 .base = 0, 302 .ngpio = 32, 303 }; 304 305 static int 306 ifxmips_gpio_probe(struct platform_device *dev) 307 { 308 gpiochip_add(&ifxmips_gpio_chip); 309 return 0; 310 } 311 312 static int 313 ifxmips_gpio_remove(struct platform_device *pdev) 314 { 315 gpiochip_remove(&ifxmips_gpio_chip); 316 return 0; 317 } 318 319 static struct platform_driver 320 ifxmips_gpio_driver = { 336 321 .probe = ifxmips_gpio_probe, 337 322 .remove = ifxmips_gpio_remove, … … 342 327 }; 343 328 344 int __init ifxmips_gpio_init(void) 329 int __init 330 ifxmips_gpio_init(void) 345 331 { 346 332 int ret = platform_driver_register(&ifxmips_gpio_driver); … … 350 336 } 351 337 352 void __exit ifxmips_gpio_exit(void) 338 void __exit 339 ifxmips_gpio_exit(void) 353 340 { 354 341 platform_driver_unregister(&ifxmips_gpio_driver); -
trunk/target/linux/ifxmips/files/arch/mips/include/asm/mach-ifxmips/ifxmips_irq.h
r18259 r20418 67 67 #define IFXMIPS_PPE_MBOX_INT (INT_NUM_IM2_IRL0 + 24) 68 68 69 #define IFXMIPS_USB_INT (INT_NUM_IM4_IRL0 + 22) 70 #define IFXMIPS_USB_OC_INT (INT_NUM_IM4_IRL0 + 23) 69 #define INT_NUM_IM4_IRL14 (INT_NUM_IM4_IRL0 + 14) 70 #define INT_NUM_IM4_IRL18 (INT_NUM_IM4_IRL0 + 18) 71 #define INT_NUM_IM4_IRL19 (INT_NUM_IM4_IRL0 + 19) 72 #define IFXMIPS_USB_INT (INT_NUM_IM4_IRL0 + 22) 73 #define IFXMIPS_USB_OC_INT (INT_NUM_IM4_IRL0 + 23) 71 74 72 75 -
trunk/target/linux/ifxmips/patches-2.6.30/100-board.patch
r18010 r20418 1 Index: linux-2.6.30. 5/arch/mips/Kconfig1 Index: linux-2.6.30.10/arch/mips/Kconfig 2 2 =================================================================== 3 --- linux-2.6.30. 5.orig/arch/mips/Kconfig 2009-09-02 22:12:48.000000000 +02004 +++ linux-2.6.30. 5/arch/mips/Kconfig 2009-09-03 01:18:31.000000000 +02005 @@ -79,6 +79,2 4@@3 --- linux-2.6.30.10.orig/arch/mips/Kconfig 2010-03-24 15:32:02.000000000 +0100 4 +++ linux-2.6.30.10/arch/mips/Kconfig 2010-03-24 21:56:29.000000000 +0100 5 @@ -79,6 +79,23 @@ 6 6 select SYS_SUPPORTS_64BIT_KERNEL 7 7 select SYS_SUPPORTS_LITTLE_ENDIAN … … 21 21 + select SYS_HAS_EARLY_PRINTK 22 22 + select HW_HAS_PCI 23 + select GENERIC_GPIO 24 + select ARCH_WANT_OPTIONAL_GPIOLIB 23 + select ARCH_REQUIRE_GPIOLIB 25 24 + select SWAP_IO_SPACE 26 25 + … … 28 27 bool "DECstations" 29 28 select BOOT_ELF32 30 @@ -643,6 +66 1,7 @@29 @@ -643,6 +660,7 @@ 31 30 source "arch/mips/txx9/Kconfig" 32 31 source "arch/mips/vr41xx/Kconfig" … … 36 35 endmenu 37 36 38 Index: linux-2.6.30. 5/arch/mips/Makefile37 Index: linux-2.6.30.10/arch/mips/Makefile 39 38 =================================================================== 40 --- linux-2.6.30. 5.orig/arch/mips/Makefile 2009-09-02 22:12:48.000000000 +020041 +++ linux-2.6.30. 5/arch/mips/Makefile 2009-09-02 22:12:53.000000000 +020039 --- linux-2.6.30.10.orig/arch/mips/Makefile 2010-03-24 15:32:02.000000000 +0100 40 +++ linux-2.6.30.10/arch/mips/Makefile 2010-03-24 15:32:04.000000000 +0100 42 41 @@ -290,6 +290,13 @@ 43 42 load-$(CONFIG_MIPS_COBALT) += 0xffffffff80080000 … … 54 53 # 55 54 core-$(CONFIG_MACH_DECSTATION) += arch/mips/dec/ 56 Index: linux-2.6.30. 5/arch/mips/include/asm/bootinfo.h55 Index: linux-2.6.30.10/arch/mips/include/asm/bootinfo.h 57 56 =================================================================== 58 --- linux-2.6.30. 5.orig/arch/mips/include/asm/bootinfo.h 2009-09-02 22:12:48.000000000 +020059 +++ linux-2.6.30. 5/arch/mips/include/asm/bootinfo.h 2009-09-02 22:13:05.000000000 +020057 --- linux-2.6.30.10.orig/arch/mips/include/asm/bootinfo.h 2009-12-04 07:00:07.000000000 +0100 58 +++ linux-2.6.30.10/arch/mips/include/asm/bootinfo.h 2010-03-24 15:32:04.000000000 +0100 60 59 @@ -57,6 +57,8 @@ 61 60 #define MACH_MIKROTIK_RB532 0 /* Mikrotik RouterBoard 532 */
Note: See TracChangeset
for help on using the changeset viewer.