Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'blackfin-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/realmz6/blackfin-linux

Pull blackfin updates from Steven Miao:
"Blackfin gpio changes, add adi pinctrl driver, and bug fixes"

* tag 'blackfin-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/realmz6/blackfin-linux:
blackfin: fix build warning for unused variable
smp: bf561: and smb_wmb()/smp_rmb() at ipi send/receive
pm: use GFP_ATOMIC when pm core call this function
blackfin: serial: Add serial port_fer and port_mux early platform resources.
blackfin: pinctrl-adi2: code cleanup after using pinctrl-adi2
blackfin: adi gpio driver and pinctrl driver support
bf609: update default config for spi
Blackfin: bfin_gpio: Use proper mask for comparing pfunc

+1026 -711
+1 -1
arch/blackfin/configs/BF609-EZKIT_defconfig
··· 102 102 CONFIG_I2C_BLACKFIN_TWI=y 103 103 CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100 104 104 CONFIG_SPI=y 105 - CONFIG_SPI_BFIN6XX=y 105 + CONFIG_SPI_BFIN_V3=y 106 106 CONFIG_GPIOLIB=y 107 107 CONFIG_GPIO_SYSFS=y 108 108 # CONFIG_HWMON is not set
+1 -2
arch/blackfin/include/asm/irq.h
··· 23 23 /* 24 24 * pm save bfin pint registers 25 25 */ 26 - struct bfin_pm_pint_save { 27 - u32 mask_set; 26 + struct adi_pm_pint_save { 28 27 u32 assign; 29 28 u32 edge_set; 30 29 u32 invert_set;
+3 -3
arch/blackfin/include/asm/irq_handler.h
··· 12 12 #include <mach/irq.h> 13 13 14 14 /* init functions only */ 15 - extern int __init init_arch_irq(void); 15 + extern int init_arch_irq(void); 16 16 extern void init_exception_vectors(void); 17 - extern void __init program_IAR(void); 17 + extern void program_IAR(void); 18 18 #ifdef init_mach_irq 19 - extern void __init init_mach_irq(void); 19 + extern void init_mach_irq(void); 20 20 #else 21 21 # define init_mach_irq() 22 22 #endif
+18 -143
arch/blackfin/kernel/bfin_gpio.c
··· 11 11 #include <linux/err.h> 12 12 #include <linux/proc_fs.h> 13 13 #include <linux/seq_file.h> 14 - #include <asm/blackfin.h> 15 - #include <asm/gpio.h> 16 - #include <asm/portmux.h> 14 + #include <linux/gpio.h> 17 15 #include <linux/irq.h> 18 - #include <asm/irq_handler.h> 19 16 20 17 #if ANOMALY_05000311 || ANOMALY_05000323 21 18 enum { ··· 55 58 (struct gpio_port_t *) FIO0_FLAG_D, 56 59 (struct gpio_port_t *) FIO1_FLAG_D, 57 60 (struct gpio_port_t *) FIO2_FLAG_D, 58 - #elif defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 59 - (struct gpio_port_t *)PORTA_FER, 60 - (struct gpio_port_t *)PORTB_FER, 61 - (struct gpio_port_t *)PORTC_FER, 62 - (struct gpio_port_t *)PORTD_FER, 63 - (struct gpio_port_t *)PORTE_FER, 64 - (struct gpio_port_t *)PORTF_FER, 65 - (struct gpio_port_t *)PORTG_FER, 66 - # if defined(CONFIG_BF54x) 67 - (struct gpio_port_t *)PORTH_FER, 68 - (struct gpio_port_t *)PORTI_FER, 69 - (struct gpio_port_t *)PORTJ_FER, 70 - # endif 71 61 #else 72 62 # error no gpio arrays defined 73 63 #endif ··· 153 169 154 170 inline int check_gpio(unsigned gpio) 155 171 { 156 - #if defined(CONFIG_BF54x) 157 - if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 158 - || gpio == GPIO_PH14 || gpio == GPIO_PH15 159 - || gpio == GPIO_PJ14 || gpio == GPIO_PJ15) 160 - return -EINVAL; 161 - #endif 162 172 if (gpio >= MAX_BLACKFIN_GPIOS) 163 173 return -EINVAL; 164 174 return 0; ··· 189 211 *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio); 190 212 else 191 213 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); 192 - SSYNC(); 193 - #elif defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 194 - if (usage == GPIO_USAGE) 195 - gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio); 196 - else 197 - gpio_array[gpio_bank(gpio)]->port_fer |= gpio_bit(gpio); 198 214 SSYNC(); 199 215 #endif 200 216 } ··· 227 255 u16 ident = P_IDENT(per); 228 256 u16 function = P_FUNCT2MUX(per); 229 257 s8 offset = port_mux[ident]; 230 - u16 m, pmux, pfunc; 258 + u16 m, pmux, pfunc, mask; 231 259 232 260 if (offset < 0) 233 261 return 0; ··· 242 270 continue; 243 271 244 272 if (offset == 1) 245 - pfunc = (pmux >> offset) & 3; 273 + mask = 3; 246 274 else 247 - pfunc = (pmux >> offset) & 1; 248 - if (pfunc != function) { 275 + mask = 1; 276 + 277 + pfunc = (pmux >> offset) & mask; 278 + if (pfunc != (function & mask)) { 249 279 pr_err("pin group conflict! request pin %d func %d conflict with pin %d func %d\n", 250 280 ident, function, m, pfunc); 251 281 return -EINVAL; ··· 262 288 u16 ident = P_IDENT(per); 263 289 u16 function = P_FUNCT2MUX(per); 264 290 s8 offset = port_mux[ident]; 265 - u16 pmux; 291 + u16 pmux, mask; 266 292 267 293 if (offset == -1) 268 294 return; 269 295 270 296 pmux = bfin_read_PORT_MUX(); 271 - if (offset != 1) 272 - pmux &= ~(1 << offset); 297 + if (offset == 1) 298 + mask = 3; 273 299 else 274 - pmux &= ~(3 << 1); 275 - pmux |= (function << offset); 300 + mask = 1; 301 + 302 + pmux &= ~(mask << offset); 303 + pmux |= ((function & mask) << offset); 304 + 276 305 bfin_write_PORT_MUX(pmux); 277 - } 278 - #elif defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 279 - inline void portmux_setup(unsigned short per) 280 - { 281 - u16 ident = P_IDENT(per); 282 - u16 function = P_FUNCT2MUX(per); 283 - u32 pmux; 284 - 285 - pmux = gpio_array[gpio_bank(ident)]->port_mux; 286 - 287 - pmux &= ~(0x3 << (2 * gpio_sub_n(ident))); 288 - pmux |= (function & 0x3) << (2 * gpio_sub_n(ident)); 289 - 290 - gpio_array[gpio_bank(ident)]->port_mux = pmux; 291 - } 292 - 293 - inline u16 get_portmux(unsigned short per) 294 - { 295 - u16 ident = P_IDENT(per); 296 - u32 pmux = gpio_array[gpio_bank(ident)]->port_mux; 297 - return (pmux >> (2 * gpio_sub_n(ident)) & 0x3); 298 - } 299 - static int portmux_group_check(unsigned short per) 300 - { 301 - return 0; 302 306 } 303 307 #elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x) 304 308 static int portmux_group_check(unsigned short per) ··· 331 379 } 332 380 #endif 333 381 334 - #if !(defined(CONFIG_BF54x) || defined(CONFIG_BF60x)) 335 382 /*********************************************************** 336 383 * 337 384 * FUNCTIONS: Blackfin General Purpose Ports Access Functions ··· 523 572 ************************************************************* 524 573 * MODIFICATION HISTORY : 525 574 **************************************************************/ 526 - int gpio_pm_wakeup_ctrl(unsigned gpio, unsigned ctrl) 575 + int bfin_gpio_pm_wakeup_ctrl(unsigned gpio, unsigned ctrl) 527 576 { 528 577 unsigned long flags; 529 578 ··· 542 591 return 0; 543 592 } 544 593 545 - int bfin_pm_standby_ctrl(unsigned ctrl) 594 + int bfin_gpio_pm_standby_ctrl(unsigned ctrl) 546 595 { 547 596 u16 bank, mask, i; 548 597 ··· 633 682 634 683 635 684 #endif 636 - #else /* CONFIG_BF54x || CONFIG_BF60x */ 637 - #ifdef CONFIG_PM 638 - 639 - int bfin_pm_standby_ctrl(unsigned ctrl) 640 - { 641 - return 0; 642 - } 643 - 644 - void bfin_gpio_pm_hibernate_suspend(void) 645 - { 646 - int i, bank; 647 - 648 - for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { 649 - bank = gpio_bank(i); 650 - 651 - gpio_bank_saved[bank].fer = gpio_array[bank]->port_fer; 652 - gpio_bank_saved[bank].mux = gpio_array[bank]->port_mux; 653 - gpio_bank_saved[bank].data = gpio_array[bank]->data; 654 - gpio_bank_saved[bank].inen = gpio_array[bank]->inen; 655 - gpio_bank_saved[bank].dir = gpio_array[bank]->dir_set; 656 - } 657 - } 658 - 659 - void bfin_gpio_pm_hibernate_restore(void) 660 - { 661 - int i, bank; 662 - 663 - for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { 664 - bank = gpio_bank(i); 665 - 666 - gpio_array[bank]->port_mux = gpio_bank_saved[bank].mux; 667 - gpio_array[bank]->port_fer = gpio_bank_saved[bank].fer; 668 - gpio_array[bank]->inen = gpio_bank_saved[bank].inen; 669 - gpio_array[bank]->data_set = gpio_bank_saved[bank].data 670 - & gpio_bank_saved[bank].dir; 671 - gpio_array[bank]->dir_set = gpio_bank_saved[bank].dir; 672 - } 673 - } 674 - #endif 675 - 676 - unsigned short get_gpio_dir(unsigned gpio) 677 - { 678 - return (0x01 & (gpio_array[gpio_bank(gpio)]->dir_clear >> gpio_sub_n(gpio))); 679 - } 680 - EXPORT_SYMBOL(get_gpio_dir); 681 - 682 - #endif /* CONFIG_BF54x || CONFIG_BF60x */ 683 685 684 686 /*********************************************************** 685 687 * ··· 689 785 * be requested and used by several drivers 690 786 */ 691 787 692 - #if defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 693 - if (!((per & P_MAYSHARE) && get_portmux(per) == P_FUNCT2MUX(per))) { 694 - #else 695 788 if (!(per & P_MAYSHARE)) { 696 - #endif 697 789 /* 698 790 * Allow that the identical pin function can 699 791 * be requested from the same driver twice ··· 838 938 if (unlikely(is_reserved(gpio_irq, gpio, 1))) { 839 939 printk(KERN_NOTICE "bfin-gpio: GPIO %d is already reserved as gpio-irq!" 840 940 " (Documentation/blackfin/bfin-gpio-notes.txt)\n", gpio); 841 - } 842 - #if !(defined(CONFIG_BF54x) || defined(CONFIG_BF60x)) 843 - else { /* Reset POLAR setting when acquiring a gpio for the first time */ 941 + } else { /* Reset POLAR setting when acquiring a gpio for the first time */ 844 942 set_gpio_polar(gpio, 0); 845 943 } 846 - #endif 847 944 848 945 reserve(gpio, gpio); 849 946 set_label(gpio, label); ··· 1009 1112 1010 1113 static inline void __bfin_gpio_direction_input(unsigned gpio) 1011 1114 { 1012 - #if defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 1013 - gpio_array[gpio_bank(gpio)]->dir_clear = gpio_bit(gpio); 1014 - #else 1015 1115 gpio_array[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio); 1016 - #endif 1017 1116 gpio_array[gpio_bank(gpio)]->inen |= gpio_bit(gpio); 1018 1117 } 1019 1118 ··· 1033 1140 1034 1141 void bfin_gpio_irq_prepare(unsigned gpio) 1035 1142 { 1036 - #if defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 1037 - unsigned long flags; 1038 - #endif 1039 - 1040 1143 port_setup(gpio, GPIO_USAGE); 1041 - 1042 - #if defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 1043 - flags = hard_local_irq_save(); 1044 - __bfin_gpio_direction_input(gpio); 1045 - hard_local_irq_restore(flags); 1046 - #endif 1047 1144 } 1048 1145 1049 1146 void bfin_gpio_set_value(unsigned gpio, int arg) ··· 1058 1175 1059 1176 gpio_array[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio); 1060 1177 gpio_set_value(gpio, value); 1061 - #if defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 1062 - gpio_array[gpio_bank(gpio)]->dir_set = gpio_bit(gpio); 1063 - #else 1064 1178 gpio_array[gpio_bank(gpio)]->dir |= gpio_bit(gpio); 1065 - #endif 1066 1179 1067 1180 AWA_DUMMY_READ(dir); 1068 1181 hard_local_irq_restore(flags); ··· 1069 1190 1070 1191 int bfin_gpio_get_value(unsigned gpio) 1071 1192 { 1072 - #if defined(CONFIG_BF54x) || defined(CONFIG_BF60x) 1073 - return (1 & (gpio_array[gpio_bank(gpio)]->data >> gpio_sub_n(gpio))); 1074 - #else 1075 1193 unsigned long flags; 1076 1194 1077 1195 if (unlikely(get_gpio_edge(gpio))) { ··· 1081 1205 return ret; 1082 1206 } else 1083 1207 return get_gpio_data(gpio); 1084 - #endif 1085 1208 } 1086 1209 EXPORT_SYMBOL(bfin_gpio_get_value); 1087 1210
-34
arch/blackfin/mach-bf548/Kconfig
··· 377 377 378 378 endmenu 379 379 380 - comment "Pin Interrupt to Port Assignment" 381 - menu "Assignment" 382 - 383 - config PINTx_REASSIGN 384 - bool "Reprogram PINT Assignment" 385 - default y 386 - help 387 - The interrupt assignment registers controls the pin-to-interrupt 388 - assignment in a byte-wide manner. Each option allows you to select 389 - a set of pins (High/Low Byte) of an specific Port being mapped 390 - to one of the four PIN Interrupts IRQ_PINTx. 391 - 392 - You shouldn't change any of these unless you know exactly what you're doing. 393 - Please consult the Blackfin BF54x Processor Hardware Reference Manual. 394 - 395 - config PINT0_ASSIGN 396 - hex "PINT0_ASSIGN" 397 - depends on PINTx_REASSIGN 398 - default 0x00000101 399 - config PINT1_ASSIGN 400 - hex "PINT1_ASSIGN" 401 - depends on PINTx_REASSIGN 402 - default 0x01010000 403 - config PINT2_ASSIGN 404 - hex "PINT2_ASSIGN" 405 - depends on PINTx_REASSIGN 406 - default 0x07000101 407 - config PINT3_ASSIGN 408 - hex "PINT3_ASSIGN" 409 - depends on PINTx_REASSIGN 410 - default 0x02020303 411 - 412 - endmenu 413 - 414 380 endmenu 415 381 416 382 endif
+516 -22
arch/blackfin/mach-bf548/boards/ezkit.c
··· 17 17 #include <linux/i2c.h> 18 18 #include <linux/interrupt.h> 19 19 #include <linux/usb/musb.h> 20 + #include <linux/pinctrl/machine.h> 21 + #include <linux/pinctrl/pinconf-generic.h> 22 + #include <linux/platform_data/pinctrl-adi2.h> 20 23 #include <asm/bfin5xx_spi.h> 21 24 #include <asm/dma.h> 22 25 #include <asm/gpio.h> ··· 244 241 .end = UART0_RBR+2, 245 242 .flags = IORESOURCE_MEM, 246 243 }, 244 + #ifdef CONFIG_EARLY_PRINTK 245 + { 246 + .start = PORTE_FER, 247 + .end = PORTE_FER+2, 248 + .flags = IORESOURCE_REG, 249 + }, 250 + #endif 247 251 { 248 252 .start = IRQ_UART0_TX, 249 253 .end = IRQ_UART0_TX, ··· 299 289 .end = UART1_RBR+2, 300 290 .flags = IORESOURCE_MEM, 301 291 }, 292 + #ifdef CONFIG_EARLY_PRINTK 293 + { 294 + .start = PORTH_FER, 295 + .end = PORTH_FER+2, 296 + .flags = IORESOURCE_REG, 297 + }, 298 + #endif 302 299 { 303 300 .start = IRQ_UART1_TX, 304 301 .end = IRQ_UART1_TX, ··· 370 353 .end = UART2_RBR+2, 371 354 .flags = IORESOURCE_MEM, 372 355 }, 356 + #ifdef CONFIG_EARLY_PRINTK 357 + { 358 + .start = PORTB_FER, 359 + .end = PORTB_FER+2, 360 + .flags = IORESOURCE_REG, 361 + }, 362 + #endif 373 363 { 374 364 .start = IRQ_UART2_TX, 375 365 .end = IRQ_UART2_TX, ··· 425 401 .end = UART3_RBR+2, 426 402 .flags = IORESOURCE_MEM, 427 403 }, 404 + #ifdef CONFIG_EARLY_PRINTK 405 + { 406 + .start = PORTB_FER, 407 + .end = PORTB_FER+2, 408 + .flags = IORESOURCE_REG, 409 + }, 410 + #endif 428 411 { 429 412 .start = IRQ_UART3_TX, 430 413 .end = IRQ_UART3_TX, ··· 1089 1058 }; 1090 1059 #endif 1091 1060 1061 + #ifdef CONFIG_PINCTRL_ADI2 1062 + 1063 + # define ADI_PINT_DEVNAME "adi-gpio-pint" 1064 + # define ADI_GPIO_DEVNAME "adi-gpio" 1065 + # define ADI_PINCTRL_DEVNAME "pinctrl-adi2" 1066 + 1067 + static struct platform_device bfin_pinctrl_device = { 1068 + .name = ADI_PINCTRL_DEVNAME, 1069 + .id = 0, 1070 + }; 1071 + 1072 + static struct resource bfin_pint0_resources[] = { 1073 + { 1074 + .start = PINT0_MASK_SET, 1075 + .end = PINT0_LATCH + 3, 1076 + .flags = IORESOURCE_MEM, 1077 + }, 1078 + { 1079 + .start = IRQ_PINT0, 1080 + .end = IRQ_PINT0, 1081 + .flags = IORESOURCE_IRQ, 1082 + }, 1083 + }; 1084 + 1085 + static struct platform_device bfin_pint0_device = { 1086 + .name = ADI_PINT_DEVNAME, 1087 + .id = 0, 1088 + .num_resources = ARRAY_SIZE(bfin_pint0_resources), 1089 + .resource = bfin_pint0_resources, 1090 + }; 1091 + 1092 + static struct resource bfin_pint1_resources[] = { 1093 + { 1094 + .start = PINT1_MASK_SET, 1095 + .end = PINT1_LATCH + 3, 1096 + .flags = IORESOURCE_MEM, 1097 + }, 1098 + { 1099 + .start = IRQ_PINT1, 1100 + .end = IRQ_PINT1, 1101 + .flags = IORESOURCE_IRQ, 1102 + }, 1103 + }; 1104 + 1105 + static struct platform_device bfin_pint1_device = { 1106 + .name = ADI_PINT_DEVNAME, 1107 + .id = 1, 1108 + .num_resources = ARRAY_SIZE(bfin_pint1_resources), 1109 + .resource = bfin_pint1_resources, 1110 + }; 1111 + 1112 + static struct resource bfin_pint2_resources[] = { 1113 + { 1114 + .start = PINT2_MASK_SET, 1115 + .end = PINT2_LATCH + 3, 1116 + .flags = IORESOURCE_MEM, 1117 + }, 1118 + { 1119 + .start = IRQ_PINT2, 1120 + .end = IRQ_PINT2, 1121 + .flags = IORESOURCE_IRQ, 1122 + }, 1123 + }; 1124 + 1125 + static struct platform_device bfin_pint2_device = { 1126 + .name = ADI_PINT_DEVNAME, 1127 + .id = 2, 1128 + .num_resources = ARRAY_SIZE(bfin_pint2_resources), 1129 + .resource = bfin_pint2_resources, 1130 + }; 1131 + 1132 + static struct resource bfin_pint3_resources[] = { 1133 + { 1134 + .start = PINT3_MASK_SET, 1135 + .end = PINT3_LATCH + 3, 1136 + .flags = IORESOURCE_MEM, 1137 + }, 1138 + { 1139 + .start = IRQ_PINT3, 1140 + .end = IRQ_PINT3, 1141 + .flags = IORESOURCE_IRQ, 1142 + }, 1143 + }; 1144 + 1145 + static struct platform_device bfin_pint3_device = { 1146 + .name = ADI_PINT_DEVNAME, 1147 + .id = 3, 1148 + .num_resources = ARRAY_SIZE(bfin_pint3_resources), 1149 + .resource = bfin_pint3_resources, 1150 + }; 1151 + 1152 + static struct resource bfin_gpa_resources[] = { 1153 + { 1154 + .start = PORTA_FER, 1155 + .end = PORTA_MUX + 3, 1156 + .flags = IORESOURCE_MEM, 1157 + }, 1158 + { /* optional */ 1159 + .start = IRQ_PA0, 1160 + .end = IRQ_PA0, 1161 + .flags = IORESOURCE_IRQ, 1162 + }, 1163 + }; 1164 + 1165 + static struct adi_pinctrl_gpio_platform_data bfin_gpa_pdata = { 1166 + .port_gpio_base = GPIO_PA0, /* Optional */ 1167 + .port_pin_base = GPIO_PA0, 1168 + .port_width = GPIO_BANKSIZE, 1169 + .pint_id = 0, /* PINT0 */ 1170 + .pint_assign = true, /* PINT upper 16 bit */ 1171 + .pint_map = 0, /* mapping mask in PINT */ 1172 + }; 1173 + 1174 + static struct platform_device bfin_gpa_device = { 1175 + .name = ADI_GPIO_DEVNAME, 1176 + .id = 0, 1177 + .num_resources = ARRAY_SIZE(bfin_gpa_resources), 1178 + .resource = bfin_gpa_resources, 1179 + .dev = { 1180 + .platform_data = &bfin_gpa_pdata, /* Passed to driver */ 1181 + }, 1182 + }; 1183 + 1184 + static struct resource bfin_gpb_resources[] = { 1185 + { 1186 + .start = PORTB_FER, 1187 + .end = PORTB_MUX + 3, 1188 + .flags = IORESOURCE_MEM, 1189 + }, 1190 + { 1191 + .start = IRQ_PB0, 1192 + .end = IRQ_PB0, 1193 + .flags = IORESOURCE_IRQ, 1194 + }, 1195 + }; 1196 + 1197 + static struct adi_pinctrl_gpio_platform_data bfin_gpb_pdata = { 1198 + .port_gpio_base = GPIO_PB0, 1199 + .port_pin_base = GPIO_PB0, 1200 + .port_width = 15, 1201 + .pint_id = 0, 1202 + .pint_assign = true, 1203 + .pint_map = 1, 1204 + }; 1205 + 1206 + static struct platform_device bfin_gpb_device = { 1207 + .name = ADI_GPIO_DEVNAME, 1208 + .id = 1, 1209 + .num_resources = ARRAY_SIZE(bfin_gpb_resources), 1210 + .resource = bfin_gpb_resources, 1211 + .dev = { 1212 + .platform_data = &bfin_gpb_pdata, /* Passed to driver */ 1213 + }, 1214 + }; 1215 + 1216 + static struct resource bfin_gpc_resources[] = { 1217 + { 1218 + .start = PORTC_FER, 1219 + .end = PORTC_MUX + 3, 1220 + .flags = IORESOURCE_MEM, 1221 + }, 1222 + { 1223 + .start = IRQ_PC0, 1224 + .end = IRQ_PC0, 1225 + .flags = IORESOURCE_IRQ, 1226 + }, 1227 + }; 1228 + 1229 + static struct adi_pinctrl_gpio_platform_data bfin_gpc_pdata = { 1230 + .port_gpio_base = GPIO_PC0, 1231 + .port_pin_base = GPIO_PC0, 1232 + .port_width = 14, 1233 + .pint_id = 2, 1234 + .pint_assign = true, 1235 + .pint_map = 0, 1236 + }; 1237 + 1238 + static struct platform_device bfin_gpc_device = { 1239 + .name = ADI_GPIO_DEVNAME, 1240 + .id = 2, 1241 + .num_resources = ARRAY_SIZE(bfin_gpc_resources), 1242 + .resource = bfin_gpc_resources, 1243 + .dev = { 1244 + .platform_data = &bfin_gpc_pdata, /* Passed to driver */ 1245 + }, 1246 + }; 1247 + 1248 + static struct resource bfin_gpd_resources[] = { 1249 + { 1250 + .start = PORTD_FER, 1251 + .end = PORTD_MUX + 3, 1252 + .flags = IORESOURCE_MEM, 1253 + }, 1254 + { 1255 + .start = IRQ_PD0, 1256 + .end = IRQ_PD0, 1257 + .flags = IORESOURCE_IRQ, 1258 + }, 1259 + }; 1260 + 1261 + static struct adi_pinctrl_gpio_platform_data bfin_gpd_pdata = { 1262 + .port_gpio_base = GPIO_PD0, 1263 + .port_pin_base = GPIO_PD0, 1264 + .port_width = GPIO_BANKSIZE, 1265 + .pint_id = 2, 1266 + .pint_assign = false, 1267 + .pint_map = 1, 1268 + }; 1269 + 1270 + static struct platform_device bfin_gpd_device = { 1271 + .name = ADI_GPIO_DEVNAME, 1272 + .id = 3, 1273 + .num_resources = ARRAY_SIZE(bfin_gpd_resources), 1274 + .resource = bfin_gpd_resources, 1275 + .dev = { 1276 + .platform_data = &bfin_gpd_pdata, /* Passed to driver */ 1277 + }, 1278 + }; 1279 + 1280 + static struct resource bfin_gpe_resources[] = { 1281 + { 1282 + .start = PORTE_FER, 1283 + .end = PORTE_MUX + 3, 1284 + .flags = IORESOURCE_MEM, 1285 + }, 1286 + { 1287 + .start = IRQ_PE0, 1288 + .end = IRQ_PE0, 1289 + .flags = IORESOURCE_IRQ, 1290 + }, 1291 + }; 1292 + 1293 + static struct adi_pinctrl_gpio_platform_data bfin_gpe_pdata = { 1294 + .port_gpio_base = GPIO_PE0, 1295 + .port_pin_base = GPIO_PE0, 1296 + .port_width = GPIO_BANKSIZE, 1297 + .pint_id = 3, 1298 + .pint_assign = true, 1299 + .pint_map = 2, 1300 + }; 1301 + 1302 + static struct platform_device bfin_gpe_device = { 1303 + .name = ADI_GPIO_DEVNAME, 1304 + .id = 4, 1305 + .num_resources = ARRAY_SIZE(bfin_gpe_resources), 1306 + .resource = bfin_gpe_resources, 1307 + .dev = { 1308 + .platform_data = &bfin_gpe_pdata, /* Passed to driver */ 1309 + }, 1310 + }; 1311 + 1312 + static struct resource bfin_gpf_resources[] = { 1313 + { 1314 + .start = PORTF_FER, 1315 + .end = PORTF_MUX + 3, 1316 + .flags = IORESOURCE_MEM, 1317 + }, 1318 + { 1319 + .start = IRQ_PF0, 1320 + .end = IRQ_PF0, 1321 + .flags = IORESOURCE_IRQ, 1322 + }, 1323 + }; 1324 + 1325 + static struct adi_pinctrl_gpio_platform_data bfin_gpf_pdata = { 1326 + .port_gpio_base = GPIO_PF0, 1327 + .port_pin_base = GPIO_PF0, 1328 + .port_width = GPIO_BANKSIZE, 1329 + .pint_id = 3, 1330 + .pint_assign = false, 1331 + .pint_map = 3, 1332 + }; 1333 + 1334 + static struct platform_device bfin_gpf_device = { 1335 + .name = ADI_GPIO_DEVNAME, 1336 + .id = 5, 1337 + .num_resources = ARRAY_SIZE(bfin_gpf_resources), 1338 + .resource = bfin_gpf_resources, 1339 + .dev = { 1340 + .platform_data = &bfin_gpf_pdata, /* Passed to driver */ 1341 + }, 1342 + }; 1343 + 1344 + static struct resource bfin_gpg_resources[] = { 1345 + { 1346 + .start = PORTG_FER, 1347 + .end = PORTG_MUX + 3, 1348 + .flags = IORESOURCE_MEM, 1349 + }, 1350 + { 1351 + .start = IRQ_PG0, 1352 + .end = IRQ_PG0, 1353 + .flags = IORESOURCE_IRQ, 1354 + }, 1355 + }; 1356 + 1357 + static struct adi_pinctrl_gpio_platform_data bfin_gpg_pdata = { 1358 + .port_gpio_base = GPIO_PG0, 1359 + .port_pin_base = GPIO_PG0, 1360 + .port_width = GPIO_BANKSIZE, 1361 + .pint_id = -1, 1362 + }; 1363 + 1364 + static struct platform_device bfin_gpg_device = { 1365 + .name = ADI_GPIO_DEVNAME, 1366 + .id = 6, 1367 + .num_resources = ARRAY_SIZE(bfin_gpg_resources), 1368 + .resource = bfin_gpg_resources, 1369 + .dev = { 1370 + .platform_data = &bfin_gpg_pdata, /* Passed to driver */ 1371 + }, 1372 + }; 1373 + 1374 + static struct resource bfin_gph_resources[] = { 1375 + { 1376 + .start = PORTH_FER, 1377 + .end = PORTH_MUX + 3, 1378 + .flags = IORESOURCE_MEM, 1379 + }, 1380 + { 1381 + .start = IRQ_PH0, 1382 + .end = IRQ_PH0, 1383 + .flags = IORESOURCE_IRQ, 1384 + }, 1385 + }; 1386 + 1387 + static struct adi_pinctrl_gpio_platform_data bfin_gph_pdata = { 1388 + .port_gpio_base = GPIO_PH0, 1389 + .port_pin_base = GPIO_PH0, 1390 + .port_width = 14, 1391 + .pint_id = -1, 1392 + }; 1393 + 1394 + static struct platform_device bfin_gph_device = { 1395 + .name = ADI_GPIO_DEVNAME, 1396 + .id = 7, 1397 + .num_resources = ARRAY_SIZE(bfin_gph_resources), 1398 + .resource = bfin_gph_resources, 1399 + .dev = { 1400 + .platform_data = &bfin_gph_pdata, /* Passed to driver */ 1401 + }, 1402 + }; 1403 + 1404 + static struct resource bfin_gpi_resources[] = { 1405 + { 1406 + .start = PORTI_FER, 1407 + .end = PORTI_MUX + 3, 1408 + .flags = IORESOURCE_MEM, 1409 + }, 1410 + { 1411 + .start = IRQ_PI0, 1412 + .end = IRQ_PI0, 1413 + .flags = IORESOURCE_IRQ, 1414 + }, 1415 + }; 1416 + 1417 + static struct adi_pinctrl_gpio_platform_data bfin_gpi_pdata = { 1418 + .port_gpio_base = GPIO_PI0, 1419 + .port_pin_base = GPIO_PI0, 1420 + .port_width = GPIO_BANKSIZE, 1421 + .pint_id = -1, 1422 + }; 1423 + 1424 + static struct platform_device bfin_gpi_device = { 1425 + .name = ADI_GPIO_DEVNAME, 1426 + .id = 8, 1427 + .num_resources = ARRAY_SIZE(bfin_gpi_resources), 1428 + .resource = bfin_gpi_resources, 1429 + .dev = { 1430 + .platform_data = &bfin_gpi_pdata, /* Passed to driver */ 1431 + }, 1432 + }; 1433 + 1434 + static struct resource bfin_gpj_resources[] = { 1435 + { 1436 + .start = PORTJ_FER, 1437 + .end = PORTJ_MUX + 3, 1438 + .flags = IORESOURCE_MEM, 1439 + }, 1440 + { 1441 + .start = IRQ_PJ0, 1442 + .end = IRQ_PJ0, 1443 + .flags = IORESOURCE_IRQ, 1444 + }, 1445 + }; 1446 + 1447 + static struct adi_pinctrl_gpio_platform_data bfin_gpj_pdata = { 1448 + .port_gpio_base = GPIO_PJ0, 1449 + .port_pin_base = GPIO_PJ0, 1450 + .port_width = 14, 1451 + .pint_id = -1, 1452 + }; 1453 + 1454 + static struct platform_device bfin_gpj_device = { 1455 + .name = ADI_GPIO_DEVNAME, 1456 + .id = 9, 1457 + .num_resources = ARRAY_SIZE(bfin_gpj_resources), 1458 + .resource = bfin_gpj_resources, 1459 + .dev = { 1460 + .platform_data = &bfin_gpj_pdata, /* Passed to driver */ 1461 + }, 1462 + }; 1463 + 1464 + #endif 1465 + 1092 1466 static struct spi_board_info bfin_spi_board_info[] __initdata = { 1093 1467 #if defined(CONFIG_MTD_M25P80) \ 1094 1468 || defined(CONFIG_MTD_M25P80_MODULE) ··· 1502 1066 .modalias = "m25p80", /* Name of spi_driver for this device */ 1503 1067 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 1504 1068 .bus_num = 0, /* Framework bus number */ 1505 - .chip_select = 1, /* SPI_SSEL1*/ 1069 + .chip_select = MAX_CTRL_CS + GPIO_PE4, /* SPI_SSEL1*/ 1506 1070 .platform_data = &bfin_spi_flash_data, 1507 1071 .controller_data = &spi_flash_chip_info, 1508 1072 .mode = SPI_MODE_3, ··· 1514 1078 .modalias = "ad183x", 1515 1079 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 1516 1080 .bus_num = 1, 1517 - .chip_select = 4, 1081 + .chip_select = MAX_CTRL_CS + GPIO_PG6, /* SPI_SSEL2 */ 1518 1082 }, 1519 1083 #endif 1520 1084 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) ··· 1524 1088 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */ 1525 1089 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ 1526 1090 .bus_num = 0, 1527 - .chip_select = 2, 1091 + .chip_select = MAX_CTRL_CS + GPIO_PE5, /* SPI_SSEL2 */ 1528 1092 }, 1529 1093 #endif 1530 1094 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) ··· 1532 1096 .modalias = "spidev", 1533 1097 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 1534 1098 .bus_num = 0, 1535 - .chip_select = 1, 1099 + .chip_select = MAX_CTRL_CS + GPIO_PE4, /* SPI_SSEL1 */ 1536 1100 }, 1537 1101 #endif 1538 1102 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE) ··· 1542 1106 .irq = IRQ_PC5, 1543 1107 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */ 1544 1108 .bus_num = 1, 1545 - .chip_select = 2, 1109 + .chip_select = MAX_CTRL_CS + GPIO_PG6, /* SPI_SSEL2 */ 1546 1110 .mode = SPI_MODE_3, 1547 1111 }, 1548 1112 #endif ··· 1588 1152 1589 1153 /* SPI controller data */ 1590 1154 static struct bfin5xx_spi_master bf54x_spi_master_info0 = { 1591 - .num_chipselect = 4, 1155 + .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS, 1592 1156 .enable_dma = 1, /* master has the ability to do dma transfer */ 1593 1157 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, 1594 1158 }; ··· 1604 1168 }; 1605 1169 1606 1170 static struct bfin5xx_spi_master bf54x_spi_master_info1 = { 1607 - .num_chipselect = 4, 1171 + .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS, 1608 1172 .enable_dma = 1, /* master has the ability to do dma transfer */ 1609 1173 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0}, 1610 1174 }; ··· 1944 1508 static struct platform_device *ezkit_devices[] __initdata = { 1945 1509 1946 1510 &bfin_dpmc, 1511 + #if defined(CONFIG_PINCTRL_ADI2) 1512 + &bfin_pinctrl_device, 1513 + &bfin_pint0_device, 1514 + &bfin_pint1_device, 1515 + &bfin_pint2_device, 1516 + &bfin_pint3_device, 1517 + &bfin_gpa_device, 1518 + &bfin_gpb_device, 1519 + &bfin_gpc_device, 1520 + &bfin_gpd_device, 1521 + &bfin_gpe_device, 1522 + &bfin_gpf_device, 1523 + &bfin_gpg_device, 1524 + &bfin_gph_device, 1525 + &bfin_gpi_device, 1526 + &bfin_gpj_device, 1527 + #endif 1947 1528 1948 1529 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 1949 1530 &rtc_device, ··· 2097 1644 #endif 2098 1645 }; 2099 1646 1647 + /* Pin control settings */ 1648 + static struct pinctrl_map __initdata bfin_pinmux_map[] = { 1649 + /* per-device maps */ 1650 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.0", "pinctrl-adi2.0", NULL, "uart0"), 1651 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.1", "pinctrl-adi2.0", NULL, "uart1"), 1652 + #ifdef CONFIG_BFIN_UART1_CTSRTS 1653 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.1", "pinctrl-adi2.0", NULL, "uart1_ctsrts"), 1654 + #endif 1655 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.2", "pinctrl-adi2.0", NULL, "uart2"), 1656 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.3", "pinctrl-adi2.0", NULL, "uart3"), 1657 + #ifdef CONFIG_BFIN_UART3_CTSRTS 1658 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.3", "pinctrl-adi2.0", NULL, "uart3_ctsrts"), 1659 + #endif 1660 + PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.0", "pinctrl-adi2.0", NULL, "uart0"), 1661 + PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.1", "pinctrl-adi2.0", NULL, "uart1"), 1662 + PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.2", "pinctrl-adi2.0", NULL, "uart2"), 1663 + PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.3", "pinctrl-adi2.0", NULL, "uart3"), 1664 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-sdh.0", "pinctrl-adi2.0", NULL, "rsi0"), 1665 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-spi.0", "pinctrl-adi2.0", NULL, "spi0"), 1666 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-spi.1", "pinctrl-adi2.0", NULL, "spi1"), 1667 + PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.0", "pinctrl-adi2.0", NULL, "twi0"), 1668 + #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ 1669 + PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.1", "pinctrl-adi2.0", NULL, "twi1"), 1670 + #endif 1671 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-rotary", "pinctrl-adi2.0", NULL, "rotary"), 1672 + PIN_MAP_MUX_GROUP_DEFAULT("bfin_can.0", "pinctrl-adi2.0", NULL, "can0"), 1673 + PIN_MAP_MUX_GROUP_DEFAULT("bfin_can.1", "pinctrl-adi2.0", NULL, "can1"), 1674 + PIN_MAP_MUX_GROUP_DEFAULT("bf54x-lq043", "pinctrl-adi2.0", NULL, "ppi0_24b"), 1675 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.0", "pinctrl-adi2.0", NULL, "sport0"), 1676 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.0", "pinctrl-adi2.0", NULL, "sport0"), 1677 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-ac97.0", "pinctrl-adi2.0", NULL, "sport0"), 1678 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.1", "pinctrl-adi2.0", NULL, "sport1"), 1679 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.1", "pinctrl-adi2.0", NULL, "sport1"), 1680 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-ac97.1", "pinctrl-adi2.0", NULL, "sport1"), 1681 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.2", "pinctrl-adi2.0", NULL, "sport2"), 1682 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.2", "pinctrl-adi2.0", NULL, "sport2"), 1683 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-ac97.2", "pinctrl-adi2.0", NULL, "sport2"), 1684 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.3", "pinctrl-adi2.0", NULL, "sport3"), 1685 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.3", "pinctrl-adi2.0", NULL, "sport3"), 1686 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-ac97.3", "pinctrl-adi2.0", NULL, "sport3"), 1687 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-sport-uart.0", "pinctrl-adi2.0", NULL, "sport0"), 1688 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-sport-uart.1", "pinctrl-adi2.0", NULL, "sport1"), 1689 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-sport-uart.2", "pinctrl-adi2.0", NULL, "sport2"), 1690 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-sport-uart.3", "pinctrl-adi2.0", NULL, "sport3"), 1691 + PIN_MAP_MUX_GROUP_DEFAULT("pata-bf54x", "pinctrl-adi2.0", NULL, "atapi"), 1692 + #ifdef CONFIG_BF548_ATAPI_ALTERNATIVE_PORT 1693 + PIN_MAP_MUX_GROUP_DEFAULT("pata-bf54x", "pinctrl-adi2.0", NULL, "atapi_alter"), 1694 + #endif 1695 + PIN_MAP_MUX_GROUP_DEFAULT("bf5xx-nand.0", "pinctrl-adi2.0", NULL, "nfc0"), 1696 + PIN_MAP_MUX_GROUP_DEFAULT("bf54x-keys", "pinctrl-adi2.0", NULL, "keys_4x4"), 1697 + }; 1698 + 2100 1699 static int __init ezkit_init(void) 2101 1700 { 2102 1701 printk(KERN_INFO "%s(): registering device resources\n", __func__); 1702 + 1703 + /* Initialize pinmuxing */ 1704 + pinctrl_register_mappings(bfin_pinmux_map, 1705 + ARRAY_SIZE(bfin_pinmux_map)); 2103 1706 2104 1707 i2c_register_board_info(0, bfin_i2c_board_info0, 2105 1708 ARRAY_SIZE(bfin_i2c_board_info0)); ··· 2186 1677 #endif 2187 1678 #ifdef CONFIG_SERIAL_BFIN_UART3 2188 1679 &bfin_uart3_device, 2189 - #endif 2190 - #endif 2191 - 2192 - #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) 2193 - #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 2194 - &bfin_sport0_uart_device, 2195 - #endif 2196 - #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART 2197 - &bfin_sport1_uart_device, 2198 - #endif 2199 - #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART 2200 - &bfin_sport2_uart_device, 2201 - #endif 2202 - #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART 2203 - &bfin_sport3_uart_device, 2204 1680 #endif 2205 1681 #endif 2206 1682 };
-8
arch/blackfin/mach-bf548/include/mach/gpio.h
··· 194 194 unsigned int port_mux; 195 195 }; 196 196 197 - struct gpio_port_s { 198 - unsigned short fer; 199 - unsigned short data; 200 - unsigned short dir; 201 - unsigned short inen; 202 - unsigned int mux; 203 - }; 204 - 205 197 #endif 206 198 207 199 #include <mach-common/ports-a.h>
+1 -1
arch/blackfin/mach-bf548/include/mach/irq.h
··· 433 433 #include <linux/types.h> 434 434 435 435 /* 436 - * bfin pint registers layout 436 + * gpio pint registers layout 437 437 */ 438 438 struct bfin_pint_regs { 439 439 u32 mask_set;
-42
arch/blackfin/mach-bf609/Kconfig
··· 9 9 10 10 menu "BF609 Specific Configuration" 11 11 12 - comment "Pin Interrupt to Port Assignment" 13 - menu "Assignment" 14 - 15 - config PINTx_REASSIGN 16 - bool "Reprogram PINT Assignment" 17 - default y 18 - help 19 - The interrupt assignment registers controls the pin-to-interrupt 20 - assignment in a byte-wide manner. Each option allows you to select 21 - a set of pins (High/Low Byte) of an specific Port being mapped 22 - to one of the four PIN Interrupts IRQ_PINTx. 23 - 24 - You shouldn't change any of these unless you know exactly what you're doing. 25 - Please consult the Blackfin BF60x Processor Hardware Reference Manual. 26 - 27 - config PINT0_ASSIGN 28 - hex "PINT0_ASSIGN" 29 - depends on PINTx_REASSIGN 30 - default 0x00000101 31 - config PINT1_ASSIGN 32 - hex "PINT1_ASSIGN" 33 - depends on PINTx_REASSIGN 34 - default 0x00000101 35 - config PINT2_ASSIGN 36 - hex "PINT2_ASSIGN" 37 - depends on PINTx_REASSIGN 38 - default 0x00000101 39 - config PINT3_ASSIGN 40 - hex "PINT3_ASSIGN" 41 - depends on PINTx_REASSIGN 42 - default 0x00000101 43 - config PINT4_ASSIGN 44 - hex "PINT3_ASSIGN" 45 - depends on PINTx_REASSIGN 46 - default 0x00000101 47 - config PINT5_ASSIGN 48 - hex "PINT3_ASSIGN" 49 - depends on PINTx_REASSIGN 50 - default 0x00000101 51 - 52 - endmenu 53 - 54 12 config SEC_IRQ_PRIORITY_LEVELS 55 13 int "SEC interrupt priority levels" 56 14 default 7
+433 -39
arch/blackfin/mach-bf609/boards/ezkit.c
··· 17 17 #include <linux/i2c.h> 18 18 #include <linux/interrupt.h> 19 19 #include <linux/usb/musb.h> 20 + #include <linux/pinctrl/machine.h> 21 + #include <linux/pinctrl/pinconf-generic.h> 22 + #include <linux/platform_data/pinctrl-adi2.h> 20 23 #include <asm/bfin_spi3.h> 21 24 #include <asm/dma.h> 22 25 #include <asm/gpio.h> ··· 108 105 #if defined(CONFIG_STMMAC_ETH) || defined(CONFIG_STMMAC_ETH_MODULE) 109 106 #include <linux/stmmac.h> 110 107 #include <linux/phy.h> 111 - 112 - static unsigned short pins[] = P_RMII0; 113 108 114 109 static struct stmmac_mdio_bus_data phy_private_data = { 115 110 .phy_mask = 1, ··· 213 212 .end = UART0_RXDIV+4, 214 213 .flags = IORESOURCE_MEM, 215 214 }, 215 + #ifdef CONFIG_EARLY_PRINTK 216 + { 217 + .start = PORTD_FER, 218 + .end = PORTD_FER+2, 219 + .flags = IORESOURCE_REG, 220 + }, 221 + { 222 + .start = PORTD_MUX, 223 + .end = PORTD_MUX+3, 224 + .flags = IORESOURCE_REG, 225 + }, 226 + #endif 216 227 { 217 228 .start = IRQ_UART0_TX, 218 229 .end = IRQ_UART0_TX, ··· 289 276 .end = UART1_RXDIV+4, 290 277 .flags = IORESOURCE_MEM, 291 278 }, 279 + #ifdef CONFIG_EARLY_PRINTK 280 + { 281 + .start = PORTG_FER_SET, 282 + .end = PORTG_FER_SET+2, 283 + .flags = IORESOURCE_REG, 284 + }, 285 + #endif 292 286 { 293 287 .start = IRQ_UART1_TX, 294 288 .end = IRQ_UART1_TX, ··· 694 674 }, 695 675 }; 696 676 697 - int bf609_nor_flash_init(struct platform_device *dev) 677 + int bf609_nor_flash_init(struct platform_device *pdev) 698 678 { 699 679 #define CONFIG_SMC_GCTL_VAL 0x00000010 700 - const unsigned short pins[] = { 701 - P_A3, P_A4, P_A5, P_A6, P_A7, P_A8, P_A9, P_A10, P_A11, P_A12, 702 - P_A13, P_A14, P_A15, P_A16, P_A17, P_A18, P_A19, P_A20, P_A21, 703 - P_A22, P_A23, P_A24, P_A25, P_NORCK, 0, 704 - }; 705 680 706 - peripheral_request_list(pins, "smc0"); 707 - 681 + if (!devm_pinctrl_get_select_default(&pdev->dev)) 682 + return -EBUSY; 708 683 bfin_write32(SMC_GCTL, CONFIG_SMC_GCTL_VAL); 709 684 bfin_write32(SMC_B0CTL, 0x01002011); 710 685 bfin_write32(SMC_B0TIM, 0x08170977); ··· 707 692 return 0; 708 693 } 709 694 710 - void bf609_nor_flash_exit(struct platform_device *dev) 695 + void bf609_nor_flash_exit(struct platform_device *pdev) 711 696 { 712 - const unsigned short pins[] = { 713 - P_A3, P_A4, P_A5, P_A6, P_A7, P_A8, P_A9, P_A10, P_A11, P_A12, 714 - P_A13, P_A14, P_A15, P_A16, P_A17, P_A18, P_A19, P_A20, P_A21, 715 - P_A22, P_A23, P_A24, P_A25, P_NORCK, 0, 716 - }; 717 - 718 - peripheral_free_list(pins); 719 - 697 + devm_pinctrl_put(pdev->dev.pins->p); 720 698 bfin_write32(SMC_GCTL, 0); 721 699 } 722 700 ··· 1327 1319 }; 1328 1320 #endif 1329 1321 1322 + #ifdef CONFIG_PINCTRL_ADI2 1323 + 1324 + # define ADI_PINT_DEVNAME "adi-gpio-pint" 1325 + # define ADI_GPIO_DEVNAME "adi-gpio" 1326 + # define ADI_PINCTRL_DEVNAME "pinctrl-adi2" 1327 + 1328 + static struct platform_device bfin_pinctrl_device = { 1329 + .name = ADI_PINCTRL_DEVNAME, 1330 + .id = 0, 1331 + }; 1332 + 1333 + static struct resource bfin_pint0_resources[] = { 1334 + { 1335 + .start = PINT0_MASK_SET, 1336 + .end = PINT0_LATCH + 3, 1337 + .flags = IORESOURCE_MEM, 1338 + }, 1339 + { 1340 + .start = IRQ_PINT0, 1341 + .end = IRQ_PINT0, 1342 + .flags = IORESOURCE_IRQ, 1343 + }, 1344 + }; 1345 + 1346 + static struct platform_device bfin_pint0_device = { 1347 + .name = ADI_PINT_DEVNAME, 1348 + .id = 0, 1349 + .num_resources = ARRAY_SIZE(bfin_pint0_resources), 1350 + .resource = bfin_pint0_resources, 1351 + }; 1352 + 1353 + static struct resource bfin_pint1_resources[] = { 1354 + { 1355 + .start = PINT1_MASK_SET, 1356 + .end = PINT1_LATCH + 3, 1357 + .flags = IORESOURCE_MEM, 1358 + }, 1359 + { 1360 + .start = IRQ_PINT1, 1361 + .end = IRQ_PINT1, 1362 + .flags = IORESOURCE_IRQ, 1363 + }, 1364 + }; 1365 + 1366 + static struct platform_device bfin_pint1_device = { 1367 + .name = ADI_PINT_DEVNAME, 1368 + .id = 1, 1369 + .num_resources = ARRAY_SIZE(bfin_pint1_resources), 1370 + .resource = bfin_pint1_resources, 1371 + }; 1372 + 1373 + static struct resource bfin_pint2_resources[] = { 1374 + { 1375 + .start = PINT2_MASK_SET, 1376 + .end = PINT2_LATCH + 3, 1377 + .flags = IORESOURCE_MEM, 1378 + }, 1379 + { 1380 + .start = IRQ_PINT2, 1381 + .end = IRQ_PINT2, 1382 + .flags = IORESOURCE_IRQ, 1383 + }, 1384 + }; 1385 + 1386 + static struct platform_device bfin_pint2_device = { 1387 + .name = ADI_PINT_DEVNAME, 1388 + .id = 2, 1389 + .num_resources = ARRAY_SIZE(bfin_pint2_resources), 1390 + .resource = bfin_pint2_resources, 1391 + }; 1392 + 1393 + static struct resource bfin_pint3_resources[] = { 1394 + { 1395 + .start = PINT3_MASK_SET, 1396 + .end = PINT3_LATCH + 3, 1397 + .flags = IORESOURCE_MEM, 1398 + }, 1399 + { 1400 + .start = IRQ_PINT3, 1401 + .end = IRQ_PINT3, 1402 + .flags = IORESOURCE_IRQ, 1403 + }, 1404 + }; 1405 + 1406 + static struct platform_device bfin_pint3_device = { 1407 + .name = ADI_PINT_DEVNAME, 1408 + .id = 3, 1409 + .num_resources = ARRAY_SIZE(bfin_pint3_resources), 1410 + .resource = bfin_pint3_resources, 1411 + }; 1412 + 1413 + static struct resource bfin_pint4_resources[] = { 1414 + { 1415 + .start = PINT4_MASK_SET, 1416 + .end = PINT4_LATCH + 3, 1417 + .flags = IORESOURCE_MEM, 1418 + }, 1419 + { 1420 + .start = IRQ_PINT4, 1421 + .end = IRQ_PINT4, 1422 + .flags = IORESOURCE_IRQ, 1423 + }, 1424 + }; 1425 + 1426 + static struct platform_device bfin_pint4_device = { 1427 + .name = ADI_PINT_DEVNAME, 1428 + .id = 4, 1429 + .num_resources = ARRAY_SIZE(bfin_pint4_resources), 1430 + .resource = bfin_pint4_resources, 1431 + }; 1432 + 1433 + static struct resource bfin_pint5_resources[] = { 1434 + { 1435 + .start = PINT5_MASK_SET, 1436 + .end = PINT5_LATCH + 3, 1437 + .flags = IORESOURCE_MEM, 1438 + }, 1439 + { 1440 + .start = IRQ_PINT5, 1441 + .end = IRQ_PINT5, 1442 + .flags = IORESOURCE_IRQ, 1443 + }, 1444 + }; 1445 + 1446 + static struct platform_device bfin_pint5_device = { 1447 + .name = ADI_PINT_DEVNAME, 1448 + .id = 5, 1449 + .num_resources = ARRAY_SIZE(bfin_pint5_resources), 1450 + .resource = bfin_pint5_resources, 1451 + }; 1452 + 1453 + static struct resource bfin_gpa_resources[] = { 1454 + { 1455 + .start = PORTA_FER, 1456 + .end = PORTA_MUX + 3, 1457 + .flags = IORESOURCE_MEM, 1458 + }, 1459 + { /* optional */ 1460 + .start = IRQ_PA0, 1461 + .end = IRQ_PA0, 1462 + .flags = IORESOURCE_IRQ, 1463 + }, 1464 + }; 1465 + 1466 + static struct adi_pinctrl_gpio_platform_data bfin_gpa_pdata = { 1467 + .port_pin_base = GPIO_PA0, 1468 + .port_width = GPIO_BANKSIZE, 1469 + .pint_id = 0, /* PINT0 */ 1470 + .pint_assign = true, /* PINT upper 16 bit */ 1471 + .pint_map = 0, /* mapping mask in PINT */ 1472 + }; 1473 + 1474 + static struct platform_device bfin_gpa_device = { 1475 + .name = ADI_GPIO_DEVNAME, 1476 + .id = 0, 1477 + .num_resources = ARRAY_SIZE(bfin_gpa_resources), 1478 + .resource = bfin_gpa_resources, 1479 + .dev = { 1480 + .platform_data = &bfin_gpa_pdata, /* Passed to driver */ 1481 + }, 1482 + }; 1483 + 1484 + static struct resource bfin_gpb_resources[] = { 1485 + { 1486 + .start = PORTB_FER, 1487 + .end = PORTB_MUX + 3, 1488 + .flags = IORESOURCE_MEM, 1489 + }, 1490 + { 1491 + .start = IRQ_PB0, 1492 + .end = IRQ_PB0, 1493 + .flags = IORESOURCE_IRQ, 1494 + }, 1495 + }; 1496 + 1497 + static struct adi_pinctrl_gpio_platform_data bfin_gpb_pdata = { 1498 + .port_pin_base = GPIO_PB0, 1499 + .port_width = GPIO_BANKSIZE, 1500 + .pint_id = 0, 1501 + .pint_assign = false, 1502 + .pint_map = 1, 1503 + }; 1504 + 1505 + static struct platform_device bfin_gpb_device = { 1506 + .name = ADI_GPIO_DEVNAME, 1507 + .id = 1, 1508 + .num_resources = ARRAY_SIZE(bfin_gpb_resources), 1509 + .resource = bfin_gpb_resources, 1510 + .dev = { 1511 + .platform_data = &bfin_gpb_pdata, /* Passed to driver */ 1512 + }, 1513 + }; 1514 + 1515 + static struct resource bfin_gpc_resources[] = { 1516 + { 1517 + .start = PORTC_FER, 1518 + .end = PORTC_MUX + 3, 1519 + .flags = IORESOURCE_MEM, 1520 + }, 1521 + { 1522 + .start = IRQ_PC0, 1523 + .end = IRQ_PC0, 1524 + .flags = IORESOURCE_IRQ, 1525 + }, 1526 + }; 1527 + 1528 + static struct adi_pinctrl_gpio_platform_data bfin_gpc_pdata = { 1529 + .port_pin_base = GPIO_PC0, 1530 + .port_width = GPIO_BANKSIZE, 1531 + .pint_id = 1, 1532 + .pint_assign = false, 1533 + .pint_map = 1, 1534 + }; 1535 + 1536 + static struct platform_device bfin_gpc_device = { 1537 + .name = ADI_GPIO_DEVNAME, 1538 + .id = 2, 1539 + .num_resources = ARRAY_SIZE(bfin_gpc_resources), 1540 + .resource = bfin_gpc_resources, 1541 + .dev = { 1542 + .platform_data = &bfin_gpc_pdata, /* Passed to driver */ 1543 + }, 1544 + }; 1545 + 1546 + static struct resource bfin_gpd_resources[] = { 1547 + { 1548 + .start = PORTD_FER, 1549 + .end = PORTD_MUX + 3, 1550 + .flags = IORESOURCE_MEM, 1551 + }, 1552 + { 1553 + .start = IRQ_PD0, 1554 + .end = IRQ_PD0, 1555 + .flags = IORESOURCE_IRQ, 1556 + }, 1557 + }; 1558 + 1559 + static struct adi_pinctrl_gpio_platform_data bfin_gpd_pdata = { 1560 + .port_pin_base = GPIO_PD0, 1561 + .port_width = GPIO_BANKSIZE, 1562 + .pint_id = 2, 1563 + .pint_assign = false, 1564 + .pint_map = 1, 1565 + }; 1566 + 1567 + static struct platform_device bfin_gpd_device = { 1568 + .name = ADI_GPIO_DEVNAME, 1569 + .id = 3, 1570 + .num_resources = ARRAY_SIZE(bfin_gpd_resources), 1571 + .resource = bfin_gpd_resources, 1572 + .dev = { 1573 + .platform_data = &bfin_gpd_pdata, /* Passed to driver */ 1574 + }, 1575 + }; 1576 + 1577 + static struct resource bfin_gpe_resources[] = { 1578 + { 1579 + .start = PORTE_FER, 1580 + .end = PORTE_MUX + 3, 1581 + .flags = IORESOURCE_MEM, 1582 + }, 1583 + { 1584 + .start = IRQ_PE0, 1585 + .end = IRQ_PE0, 1586 + .flags = IORESOURCE_IRQ, 1587 + }, 1588 + }; 1589 + 1590 + static struct adi_pinctrl_gpio_platform_data bfin_gpe_pdata = { 1591 + .port_pin_base = GPIO_PE0, 1592 + .port_width = GPIO_BANKSIZE, 1593 + .pint_id = 3, 1594 + .pint_assign = false, 1595 + .pint_map = 1, 1596 + }; 1597 + 1598 + static struct platform_device bfin_gpe_device = { 1599 + .name = ADI_GPIO_DEVNAME, 1600 + .id = 4, 1601 + .num_resources = ARRAY_SIZE(bfin_gpe_resources), 1602 + .resource = bfin_gpe_resources, 1603 + .dev = { 1604 + .platform_data = &bfin_gpe_pdata, /* Passed to driver */ 1605 + }, 1606 + }; 1607 + 1608 + static struct resource bfin_gpf_resources[] = { 1609 + { 1610 + .start = PORTF_FER, 1611 + .end = PORTF_MUX + 3, 1612 + .flags = IORESOURCE_MEM, 1613 + }, 1614 + { 1615 + .start = IRQ_PF0, 1616 + .end = IRQ_PF0, 1617 + .flags = IORESOURCE_IRQ, 1618 + }, 1619 + }; 1620 + 1621 + static struct adi_pinctrl_gpio_platform_data bfin_gpf_pdata = { 1622 + .port_pin_base = GPIO_PF0, 1623 + .port_width = GPIO_BANKSIZE, 1624 + .pint_id = 4, 1625 + .pint_assign = false, 1626 + .pint_map = 1, 1627 + }; 1628 + 1629 + static struct platform_device bfin_gpf_device = { 1630 + .name = ADI_GPIO_DEVNAME, 1631 + .id = 5, 1632 + .num_resources = ARRAY_SIZE(bfin_gpf_resources), 1633 + .resource = bfin_gpf_resources, 1634 + .dev = { 1635 + .platform_data = &bfin_gpf_pdata, /* Passed to driver */ 1636 + }, 1637 + }; 1638 + 1639 + static struct resource bfin_gpg_resources[] = { 1640 + { 1641 + .start = PORTG_FER, 1642 + .end = PORTG_MUX + 3, 1643 + .flags = IORESOURCE_MEM, 1644 + }, 1645 + { 1646 + .start = IRQ_PG0, 1647 + .end = IRQ_PG0, 1648 + .flags = IORESOURCE_IRQ, 1649 + }, 1650 + }; 1651 + 1652 + static struct adi_pinctrl_gpio_platform_data bfin_gpg_pdata = { 1653 + .port_pin_base = GPIO_PG0, 1654 + .port_width = GPIO_BANKSIZE, 1655 + .pint_id = 5, 1656 + .pint_assign = false, 1657 + .pint_map = 1, 1658 + }; 1659 + 1660 + static struct platform_device bfin_gpg_device = { 1661 + .name = ADI_GPIO_DEVNAME, 1662 + .id = 6, 1663 + .num_resources = ARRAY_SIZE(bfin_gpg_resources), 1664 + .resource = bfin_gpg_resources, 1665 + .dev = { 1666 + .platform_data = &bfin_gpg_pdata, /* Passed to driver */ 1667 + }, 1668 + }; 1669 + 1670 + #endif 1671 + 1330 1672 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 1331 1673 #include <linux/input.h> 1332 1674 #include <linux/gpio_keys.h> ··· 1707 1349 .modalias = "m25p80", /* Name of spi_driver for this device */ 1708 1350 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 1709 1351 .bus_num = 0, /* Framework bus number */ 1710 - .chip_select = 1, /* SPI_SSEL1*/ 1352 + .chip_select = MAX_CTRL_CS + GPIO_PD11, /* SPI_SSEL1*/ 1711 1353 .platform_data = &bfin_spi_flash_data, 1712 1354 .controller_data = &spi_flash_chip_info, 1713 1355 .mode = SPI_MODE_3, ··· 1720 1362 .irq = IRQ_PD9, 1721 1363 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ 1722 1364 .bus_num = 0, 1723 - .chip_select = 4, 1365 + .chip_select = MAX_CTRL_CS + GPIO_PC15, /* SPI_SSEL4 */ 1724 1366 }, 1725 1367 #endif 1726 1368 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) ··· 1728 1370 .modalias = "spidev", 1729 1371 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 1730 1372 .bus_num = 0, 1731 - .chip_select = 1, 1373 + .chip_select = MAX_CTRL_CS + GPIO_PD11, /* SPI_SSEL1*/ 1732 1374 .controller_data = &spidev_chip_info, 1733 1375 }, 1734 1376 #endif ··· 1923 1565 static struct platform_device *ezkit_devices[] __initdata = { 1924 1566 1925 1567 &bfin_dpmc, 1568 + #if defined(CONFIG_PINCTRL_ADI2) 1569 + &bfin_pinctrl_device, 1570 + &bfin_pint0_device, 1571 + &bfin_pint1_device, 1572 + &bfin_pint2_device, 1573 + &bfin_pint3_device, 1574 + &bfin_pint4_device, 1575 + &bfin_pint5_device, 1576 + &bfin_gpa_device, 1577 + &bfin_gpb_device, 1578 + &bfin_gpc_device, 1579 + &bfin_gpd_device, 1580 + &bfin_gpe_device, 1581 + &bfin_gpf_device, 1582 + &bfin_gpg_device, 1583 + #endif 1926 1584 1927 1585 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 1928 1586 &rtc_device, ··· 2055 1681 2056 1682 }; 2057 1683 1684 + /* Pin control settings */ 1685 + static struct pinctrl_map __initdata bfin_pinmux_map[] = { 1686 + /* per-device maps */ 1687 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.0", "pinctrl-adi2.0", NULL, "uart0"), 1688 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-uart.1", "pinctrl-adi2.0", NULL, "uart1"), 1689 + PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.0", "pinctrl-adi2.0", NULL, "uart0"), 1690 + PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.1", "pinctrl-adi2.0", NULL, "uart1"), 1691 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-sdh.0", "pinctrl-adi2.0", NULL, "rsi0"), 1692 + PIN_MAP_MUX_GROUP_DEFAULT("stmmaceth.0", "pinctrl-adi2.0", NULL, "eth0"), 1693 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-spi3.0", "pinctrl-adi2.0", NULL, "spi0"), 1694 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-spi3.1", "pinctrl-adi2.0", NULL, "spi1"), 1695 + PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.0", "pinctrl-adi2.0", NULL, "twi0"), 1696 + PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.1", "pinctrl-adi2.0", NULL, "twi1"), 1697 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-rotary", "pinctrl-adi2.0", NULL, "rotary"), 1698 + PIN_MAP_MUX_GROUP_DEFAULT("bfin_can.0", "pinctrl-adi2.0", NULL, "can0"), 1699 + PIN_MAP_MUX_GROUP_DEFAULT("physmap-flash.0", "pinctrl-adi2.0", NULL, "smc0"), 1700 + PIN_MAP_MUX_GROUP_DEFAULT("bf609_nl8048.2", "pinctrl-adi2.0", NULL, "ppi2_16b"), 1701 + PIN_MAP_MUX_GROUP_DEFAULT("bfin_display.0", "pinctrl-adi2.0", NULL, "ppi0_16b"), 1702 + #if defined(CONFIG_VIDEO_MT9M114) || defined(CONFIG_VIDEO_MT9M114_MODULE) 1703 + PIN_MAP_MUX_GROUP_DEFAULT("bfin_capture.0", "pinctrl-adi2.0", NULL, "ppi0_8b"), 1704 + #elif defined(CONFIG_VIDEO_VS6624) || defined(CONFIG_VIDEO_VS6624_MODULE) 1705 + PIN_MAP_MUX_GROUP_DEFAULT("bfin_capture.0", "pinctrl-adi2.0", NULL, "ppi0_16b"), 1706 + #else 1707 + PIN_MAP_MUX_GROUP_DEFAULT("bfin_capture.0", "pinctrl-adi2.0", NULL, "ppi0_24b"), 1708 + #endif 1709 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.0", "pinctrl-adi2.0", NULL, "sport0"), 1710 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.0", "pinctrl-adi2.0", NULL, "sport0"), 1711 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.1", "pinctrl-adi2.0", NULL, "sport1"), 1712 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.1", "pinctrl-adi2.0", NULL, "sport1"), 1713 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-i2s.2", "pinctrl-adi2.0", NULL, "sport2"), 1714 + PIN_MAP_MUX_GROUP_DEFAULT("bfin-tdm.2", "pinctrl-adi2.0", NULL, "sport2"), 1715 + }; 1716 + 2058 1717 static int __init ezkit_init(void) 2059 1718 { 2060 1719 printk(KERN_INFO "%s(): registering device resources\n", __func__); 1720 + 1721 + /* Initialize pinmuxing */ 1722 + pinctrl_register_mappings(bfin_pinmux_map, 1723 + ARRAY_SIZE(bfin_pinmux_map)); 2061 1724 2062 1725 i2c_register_board_info(0, bfin_i2c_board_info0, 2063 1726 ARRAY_SIZE(bfin_i2c_board_info0)); 2064 1727 i2c_register_board_info(1, bfin_i2c_board_info1, 2065 1728 ARRAY_SIZE(bfin_i2c_board_info1)); 2066 - 2067 - #if defined(CONFIG_STMMAC_ETH) || defined(CONFIG_STMMAC_ETH_MODULE) 2068 - if (!peripheral_request_list(pins, "emac0")) 2069 - printk(KERN_ERR "%s(): request emac pins failed\n", __func__); 2070 - #endif 2071 1729 2072 1730 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); 2073 1731 ··· 2117 1711 #endif 2118 1712 #ifdef CONFIG_SERIAL_BFIN_UART1 2119 1713 &bfin_uart1_device, 2120 - #endif 2121 - #endif 2122 - 2123 - #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) 2124 - #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 2125 - &bfin_sport0_uart_device, 2126 - #endif 2127 - #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART 2128 - &bfin_sport1_uart_device, 2129 - #endif 2130 - #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART 2131 - &bfin_sport2_uart_device, 2132 1714 #endif 2133 1715 #endif 2134 1716 };
-8
arch/blackfin/mach-bf609/include/mach/gpio.h
··· 152 152 unsigned long revid; 153 153 }; 154 154 155 - struct gpio_port_s { 156 - unsigned short fer; 157 - unsigned short data; 158 - unsigned short dir; 159 - unsigned short inen; 160 - unsigned int mux; 161 - }; 162 - 163 155 #endif 164 156 165 157 #include <mach-common/ports-a.h>
+1 -1
arch/blackfin/mach-bf609/include/mach/irq.h
··· 298 298 extern u8 sec_int_priority[]; 299 299 300 300 /* 301 - * bfin pint registers layout 301 + * gpio pint registers layout 302 302 */ 303 303 struct bfin_pint_regs { 304 304 u32 mask_set;
+4
arch/blackfin/mach-bf609/include/mach/portmux.h
··· 19 19 #define P_MII0_CRS (P_DEFINED | P_IDENT(GPIO_PC5) | P_FUNCT(0)) 20 20 #define P_MII0_ERxER (P_DEFINED | P_IDENT(GPIO_PC4) | P_FUNCT(0)) 21 21 #define P_MII0_TxCLK (P_DEFINED | P_IDENT(GPIO_PB14) | P_FUNCT(0)) 22 + #define P_MII0_PTPPPS (P_DEFINED | P_IDENT(GPIO_PB15) | P_FUNCT(0)) 22 23 23 24 #define P_RMII0 {\ 24 25 P_MII0_ETxD0, \ ··· 31 30 P_MII0_TxCLK, \ 32 31 P_MII0_PHYINT, \ 33 32 P_MII0_CRS, \ 33 + P_MII0_PTPPPS, \ 34 34 P_MII0_MDC, \ 35 35 P_MII0_MDIO, 0} 36 36 ··· 46 44 #define P_MII1_CRS (P_DEFINED | P_IDENT(GPIO_PE13) | P_FUNCT(0)) 47 45 #define P_MII1_ERxER (P_DEFINED | P_IDENT(GPIO_PE14) | P_FUNCT(0)) 48 46 #define P_MII1_TxCLK (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(0)) 47 + #define P_MII1_PTPPPS (P_DEFINED | P_IDENT(GPIO_PC9) | P_FUNCT(0)) 49 48 50 49 #define P_RMII1 {\ 51 50 P_MII1_ETxD0, \ ··· 58 55 P_MII1_TxCLK, \ 59 56 P_MII1_PHYINT, \ 60 57 P_MII1_CRS, \ 58 + P_MII1_PTPPPS, \ 61 59 P_MII1_MDC, \ 62 60 P_MII1_MDIO, 0} 63 61
+29 -392
arch/blackfin/mach-common/ints-priority.c
··· 704 704 __irq_set_handler_locked(irq, handle); 705 705 } 706 706 707 - static DECLARE_BITMAP(gpio_enabled, MAX_BLACKFIN_GPIOS); 708 - extern void bfin_gpio_irq_prepare(unsigned gpio); 707 + #ifdef CONFIG_GPIO_ADI 709 708 710 - #if !BFIN_GPIO_PINT 709 + static DECLARE_BITMAP(gpio_enabled, MAX_BLACKFIN_GPIOS); 711 710 712 711 static void bfin_gpio_ack_irq(struct irq_data *d) 713 712 { ··· 820 821 return 0; 821 822 } 822 823 823 - #ifdef CONFIG_PM 824 - static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state) 825 - { 826 - return gpio_pm_wakeup_ctrl(irq_to_gpio(d->irq), state); 827 - } 828 - #else 829 - # define bfin_gpio_set_wake NULL 830 - #endif 831 - 832 824 static void bfin_demux_gpio_block(unsigned int irq) 833 825 { 834 826 unsigned int gpio, mask; ··· 886 896 bfin_demux_gpio_block(irq); 887 897 } 888 898 889 - #else 890 - 891 - #define NR_PINT_BITS 32 892 - #define IRQ_NOT_AVAIL 0xFF 893 - 894 - #define PINT_2_BANK(x) ((x) >> 5) 895 - #define PINT_2_BIT(x) ((x) & 0x1F) 896 - #define PINT_BIT(x) (1 << (PINT_2_BIT(x))) 897 - 898 - static unsigned char irq2pint_lut[NR_PINTS]; 899 - static unsigned char pint2irq_lut[NR_PINT_SYS_IRQS * NR_PINT_BITS]; 900 - 901 - static struct bfin_pint_regs * const pint[NR_PINT_SYS_IRQS] = { 902 - (struct bfin_pint_regs *)PINT0_MASK_SET, 903 - (struct bfin_pint_regs *)PINT1_MASK_SET, 904 - (struct bfin_pint_regs *)PINT2_MASK_SET, 905 - (struct bfin_pint_regs *)PINT3_MASK_SET, 906 - #ifdef CONFIG_BF60x 907 - (struct bfin_pint_regs *)PINT4_MASK_SET, 908 - (struct bfin_pint_regs *)PINT5_MASK_SET, 909 - #endif 910 - }; 911 - 912 - inline unsigned int get_irq_base(u32 bank, u8 bmap) 913 - { 914 - unsigned int irq_base; 915 - 916 - #ifndef CONFIG_BF60x 917 - if (bank < 2) { /*PA-PB */ 918 - irq_base = IRQ_PA0 + bmap * 16; 919 - } else { /*PC-PJ */ 920 - irq_base = IRQ_PC0 + bmap * 16; 921 - } 922 - #else 923 - irq_base = IRQ_PA0 + bank * 16 + bmap * 16; 924 - #endif 925 - return irq_base; 926 - } 927 - 928 - /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */ 929 - void init_pint_lut(void) 930 - { 931 - u16 bank, bit, irq_base, bit_pos; 932 - u32 pint_assign; 933 - u8 bmap; 934 - 935 - memset(irq2pint_lut, IRQ_NOT_AVAIL, sizeof(irq2pint_lut)); 936 - 937 - for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) { 938 - 939 - pint_assign = pint[bank]->assign; 940 - 941 - for (bit = 0; bit < NR_PINT_BITS; bit++) { 942 - 943 - bmap = (pint_assign >> ((bit / 8) * 8)) & 0xFF; 944 - 945 - irq_base = get_irq_base(bank, bmap); 946 - 947 - irq_base += (bit % 8) + ((bit / 8) & 1 ? 8 : 0); 948 - bit_pos = bit + bank * NR_PINT_BITS; 949 - 950 - pint2irq_lut[bit_pos] = irq_base - SYS_IRQS; 951 - irq2pint_lut[irq_base - SYS_IRQS] = bit_pos; 952 - } 953 - } 954 - } 955 - 956 - static void bfin_gpio_ack_irq(struct irq_data *d) 957 - { 958 - u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS]; 959 - u32 pintbit = PINT_BIT(pint_val); 960 - u32 bank = PINT_2_BANK(pint_val); 961 - 962 - if (irqd_get_trigger_type(d) == IRQ_TYPE_EDGE_BOTH) { 963 - if (pint[bank]->invert_set & pintbit) 964 - pint[bank]->invert_clear = pintbit; 965 - else 966 - pint[bank]->invert_set = pintbit; 967 - } 968 - pint[bank]->request = pintbit; 969 - 970 - } 971 - 972 - static void bfin_gpio_mask_ack_irq(struct irq_data *d) 973 - { 974 - u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS]; 975 - u32 pintbit = PINT_BIT(pint_val); 976 - u32 bank = PINT_2_BANK(pint_val); 977 - 978 - if (irqd_get_trigger_type(d) == IRQ_TYPE_EDGE_BOTH) { 979 - if (pint[bank]->invert_set & pintbit) 980 - pint[bank]->invert_clear = pintbit; 981 - else 982 - pint[bank]->invert_set = pintbit; 983 - } 984 - 985 - pint[bank]->request = pintbit; 986 - pint[bank]->mask_clear = pintbit; 987 - } 988 - 989 - static void bfin_gpio_mask_irq(struct irq_data *d) 990 - { 991 - u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS]; 992 - 993 - pint[PINT_2_BANK(pint_val)]->mask_clear = PINT_BIT(pint_val); 994 - } 995 - 996 - static void bfin_gpio_unmask_irq(struct irq_data *d) 997 - { 998 - u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS]; 999 - u32 pintbit = PINT_BIT(pint_val); 1000 - u32 bank = PINT_2_BANK(pint_val); 1001 - 1002 - pint[bank]->mask_set = pintbit; 1003 - } 1004 - 1005 - static unsigned int bfin_gpio_irq_startup(struct irq_data *d) 1006 - { 1007 - unsigned int irq = d->irq; 1008 - u32 gpionr = irq_to_gpio(irq); 1009 - u32 pint_val = irq2pint_lut[irq - SYS_IRQS]; 1010 - 1011 - if (pint_val == IRQ_NOT_AVAIL) { 1012 - printk(KERN_ERR 1013 - "GPIO IRQ %d :Not in PINT Assign table " 1014 - "Reconfigure Interrupt to Port Assignemt\n", irq); 1015 - return -ENODEV; 1016 - } 1017 - 1018 - if (__test_and_set_bit(gpionr, gpio_enabled)) 1019 - bfin_gpio_irq_prepare(gpionr); 1020 - 1021 - bfin_gpio_unmask_irq(d); 1022 - 1023 - return 0; 1024 - } 1025 - 1026 - static void bfin_gpio_irq_shutdown(struct irq_data *d) 1027 - { 1028 - u32 gpionr = irq_to_gpio(d->irq); 1029 - 1030 - bfin_gpio_mask_irq(d); 1031 - __clear_bit(gpionr, gpio_enabled); 1032 - bfin_gpio_irq_free(gpionr); 1033 - } 1034 - 1035 - static int bfin_gpio_irq_type(struct irq_data *d, unsigned int type) 1036 - { 1037 - unsigned int irq = d->irq; 1038 - int ret; 1039 - char buf[16]; 1040 - u32 gpionr = irq_to_gpio(irq); 1041 - u32 pint_val = irq2pint_lut[irq - SYS_IRQS]; 1042 - u32 pintbit = PINT_BIT(pint_val); 1043 - u32 bank = PINT_2_BANK(pint_val); 1044 - 1045 - if (pint_val == IRQ_NOT_AVAIL) 1046 - return -ENODEV; 1047 - 1048 - if (type == IRQ_TYPE_PROBE) { 1049 - /* only probe unenabled GPIO interrupt lines */ 1050 - if (test_bit(gpionr, gpio_enabled)) 1051 - return 0; 1052 - type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING; 1053 - } 1054 - 1055 - if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING | 1056 - IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) { 1057 - 1058 - snprintf(buf, 16, "gpio-irq%d", irq); 1059 - ret = bfin_gpio_irq_request(gpionr, buf); 1060 - if (ret) 1061 - return ret; 1062 - 1063 - if (__test_and_set_bit(gpionr, gpio_enabled)) 1064 - bfin_gpio_irq_prepare(gpionr); 1065 - 1066 - } else { 1067 - __clear_bit(gpionr, gpio_enabled); 1068 - return 0; 1069 - } 1070 - 1071 - if ((type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_LEVEL_LOW))) 1072 - pint[bank]->invert_set = pintbit; /* low or falling edge denoted by one */ 1073 - else 1074 - pint[bank]->invert_clear = pintbit; /* high or rising edge denoted by zero */ 1075 - 1076 - if ((type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) 1077 - == (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { 1078 - if (gpio_get_value(gpionr)) 1079 - pint[bank]->invert_set = pintbit; 1080 - else 1081 - pint[bank]->invert_clear = pintbit; 1082 - } 1083 - 1084 - if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { 1085 - pint[bank]->edge_set = pintbit; 1086 - bfin_set_irq_handler(irq, handle_edge_irq); 1087 - } else { 1088 - pint[bank]->edge_clear = pintbit; 1089 - bfin_set_irq_handler(irq, handle_level_irq); 1090 - } 1091 - 1092 - return 0; 1093 - } 1094 - 1095 899 #ifdef CONFIG_PM 1096 - static struct bfin_pm_pint_save save_pint_reg[NR_PINT_SYS_IRQS]; 1097 - static u32 save_pint_sec_ctl[NR_PINT_SYS_IRQS]; 1098 900 1099 901 static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state) 1100 902 { 1101 - u32 pint_irq; 1102 - u32 pint_val = irq2pint_lut[d->irq - SYS_IRQS]; 1103 - u32 bank = PINT_2_BANK(pint_val); 903 + return bfin_gpio_pm_wakeup_ctrl(irq_to_gpio(d->irq), state); 904 + } 1104 905 1105 - switch (bank) { 1106 - case 0: 1107 - pint_irq = IRQ_PINT0; 1108 - break; 1109 - case 2: 1110 - pint_irq = IRQ_PINT2; 1111 - break; 1112 - case 3: 1113 - pint_irq = IRQ_PINT3; 1114 - break; 1115 - case 1: 1116 - pint_irq = IRQ_PINT1; 1117 - break; 1118 - #ifdef CONFIG_BF60x 1119 - case 4: 1120 - pint_irq = IRQ_PINT4; 1121 - break; 1122 - case 5: 1123 - pint_irq = IRQ_PINT5; 1124 - break; 1125 - #endif 1126 - default: 1127 - return -EINVAL; 1128 - } 906 + #else 1129 907 1130 - #ifndef SEC_GCTL 1131 - bfin_internal_set_wake(pint_irq, state); 908 + # define bfin_gpio_set_wake NULL 909 + 1132 910 #endif 1133 911 1134 - return 0; 1135 - } 912 + static struct irq_chip bfin_gpio_irqchip = { 913 + .name = "GPIO", 914 + .irq_ack = bfin_gpio_ack_irq, 915 + .irq_mask = bfin_gpio_mask_irq, 916 + .irq_mask_ack = bfin_gpio_mask_ack_irq, 917 + .irq_unmask = bfin_gpio_unmask_irq, 918 + .irq_disable = bfin_gpio_mask_irq, 919 + .irq_enable = bfin_gpio_unmask_irq, 920 + .irq_set_type = bfin_gpio_irq_type, 921 + .irq_startup = bfin_gpio_irq_startup, 922 + .irq_shutdown = bfin_gpio_irq_shutdown, 923 + .irq_set_wake = bfin_gpio_set_wake, 924 + }; 1136 925 1137 - void bfin_pint_suspend(void) 1138 - { 1139 - u32 bank; 926 + #endif 1140 927 1141 - for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) { 1142 - save_pint_reg[bank].mask_set = pint[bank]->mask_set; 1143 - save_pint_reg[bank].assign = pint[bank]->assign; 1144 - save_pint_reg[bank].edge_set = pint[bank]->edge_set; 1145 - save_pint_reg[bank].invert_set = pint[bank]->invert_set; 1146 - } 1147 - } 1148 - 1149 - void bfin_pint_resume(void) 1150 - { 1151 - u32 bank; 1152 - 1153 - for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) { 1154 - pint[bank]->mask_set = save_pint_reg[bank].mask_set; 1155 - pint[bank]->assign = save_pint_reg[bank].assign; 1156 - pint[bank]->edge_set = save_pint_reg[bank].edge_set; 1157 - pint[bank]->invert_set = save_pint_reg[bank].invert_set; 1158 - } 1159 - } 928 + #ifdef CONFIG_PM 1160 929 1161 930 #ifdef SEC_GCTL 931 + static u32 save_pint_sec_ctl[NR_PINT_SYS_IRQS]; 932 + 1162 933 static int sec_suspend(void) 1163 934 { 1164 935 u32 bank; ··· 946 1195 .suspend = sec_suspend, 947 1196 .resume = sec_resume, 948 1197 }; 949 - 950 - #endif 951 - #else 952 - # define bfin_gpio_set_wake NULL 953 1198 #endif 954 1199 955 - void bfin_demux_gpio_irq(unsigned int inta_irq, 956 - struct irq_desc *desc) 957 - { 958 - u32 bank, pint_val; 959 - u32 request, irq; 960 - u32 level_mask; 961 - int umask = 0; 962 - struct irq_chip *chip = irq_desc_get_chip(desc); 963 - 964 - if (chip->irq_mask_ack) { 965 - chip->irq_mask_ack(&desc->irq_data); 966 - } else { 967 - chip->irq_mask(&desc->irq_data); 968 - if (chip->irq_ack) 969 - chip->irq_ack(&desc->irq_data); 970 - } 971 - 972 - switch (inta_irq) { 973 - case IRQ_PINT0: 974 - bank = 0; 975 - break; 976 - case IRQ_PINT2: 977 - bank = 2; 978 - break; 979 - case IRQ_PINT3: 980 - bank = 3; 981 - break; 982 - case IRQ_PINT1: 983 - bank = 1; 984 - break; 985 - #ifdef CONFIG_BF60x 986 - case IRQ_PINT4: 987 - bank = 4; 988 - break; 989 - case IRQ_PINT5: 990 - bank = 5; 991 - break; 992 1200 #endif 993 - default: 994 - return; 995 - } 996 - 997 - pint_val = bank * NR_PINT_BITS; 998 - 999 - request = pint[bank]->request; 1000 - 1001 - level_mask = pint[bank]->edge_set & request; 1002 - 1003 - while (request) { 1004 - if (request & 1) { 1005 - irq = pint2irq_lut[pint_val] + SYS_IRQS; 1006 - if (level_mask & PINT_BIT(pint_val)) { 1007 - umask = 1; 1008 - chip->irq_unmask(&desc->irq_data); 1009 - } 1010 - bfin_handle_irq(irq); 1011 - } 1012 - pint_val++; 1013 - request >>= 1; 1014 - } 1015 - 1016 - if (!umask) 1017 - chip->irq_unmask(&desc->irq_data); 1018 - } 1019 - #endif 1020 - 1021 - static struct irq_chip bfin_gpio_irqchip = { 1022 - .name = "GPIO", 1023 - .irq_ack = bfin_gpio_ack_irq, 1024 - .irq_mask = bfin_gpio_mask_irq, 1025 - .irq_mask_ack = bfin_gpio_mask_ack_irq, 1026 - .irq_unmask = bfin_gpio_unmask_irq, 1027 - .irq_disable = bfin_gpio_mask_irq, 1028 - .irq_enable = bfin_gpio_unmask_irq, 1029 - .irq_set_type = bfin_gpio_irq_type, 1030 - .irq_startup = bfin_gpio_irq_startup, 1031 - .irq_shutdown = bfin_gpio_irq_shutdown, 1032 - .irq_set_wake = bfin_gpio_set_wake, 1033 - }; 1034 1201 1035 1202 void init_exception_vectors(void) 1036 1203 { ··· 1000 1331 1001 1332 local_irq_disable(); 1002 1333 1003 - #if BFIN_GPIO_PINT 1004 - # ifdef CONFIG_PINTx_REASSIGN 1005 - pint[0]->assign = CONFIG_PINT0_ASSIGN; 1006 - pint[1]->assign = CONFIG_PINT1_ASSIGN; 1007 - pint[2]->assign = CONFIG_PINT2_ASSIGN; 1008 - pint[3]->assign = CONFIG_PINT3_ASSIGN; 1009 - # endif 1010 - /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */ 1011 - init_pint_lut(); 1012 - #endif 1013 - 1014 1334 for (irq = 0; irq <= SYS_IRQS; irq++) { 1015 1335 if (irq <= IRQ_CORETMR) 1016 1336 irq_set_chip(irq, &bfin_core_irqchip); ··· 1007 1349 irq_set_chip(irq, &bfin_internal_irqchip); 1008 1350 1009 1351 switch (irq) { 1010 - #if BFIN_GPIO_PINT 1011 - case IRQ_PINT0: 1012 - case IRQ_PINT1: 1013 - case IRQ_PINT2: 1014 - case IRQ_PINT3: 1015 - #elif defined(BF537_FAMILY) 1352 + #if !BFIN_GPIO_PINT 1353 + #if defined(BF537_FAMILY) 1016 1354 case IRQ_PH_INTA_MAC_RX: 1017 1355 case IRQ_PF_INTA_PG_INTA: 1018 1356 #elif defined(BF533_FAMILY) ··· 1026 1372 #endif 1027 1373 irq_set_chained_handler(irq, bfin_demux_gpio_irq); 1028 1374 break; 1375 + #endif 1029 1376 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 1030 1377 case IRQ_MAC_ERROR: 1031 1378 irq_set_chained_handler(irq, ··· 1074 1419 handle_level_irq); 1075 1420 #endif 1076 1421 /* if configured as edge, then will be changed to do_edge_IRQ */ 1422 + #ifdef CONFIG_GPIO_ADI 1077 1423 for (irq = GPIO_IRQ_BASE; 1078 1424 irq < (GPIO_IRQ_BASE + MAX_BLACKFIN_GPIOS); irq++) 1079 1425 irq_set_chip_and_handler(irq, &bfin_gpio_irqchip, 1080 1426 handle_level_irq); 1427 + #endif 1081 1428 bfin_write_IMASK(0); 1082 1429 CSYNC(); 1083 1430 ilat = bfin_read_ILAT(); ··· 1182 1525 1183 1526 local_irq_disable(); 1184 1527 1185 - #if BFIN_GPIO_PINT 1186 - # ifdef CONFIG_PINTx_REASSIGN 1187 - pint[0]->assign = CONFIG_PINT0_ASSIGN; 1188 - pint[1]->assign = CONFIG_PINT1_ASSIGN; 1189 - pint[2]->assign = CONFIG_PINT2_ASSIGN; 1190 - pint[3]->assign = CONFIG_PINT3_ASSIGN; 1191 - pint[4]->assign = CONFIG_PINT4_ASSIGN; 1192 - pint[5]->assign = CONFIG_PINT5_ASSIGN; 1193 - # endif 1194 - /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */ 1195 - init_pint_lut(); 1196 - #endif 1197 - 1198 1528 for (irq = 0; irq <= SYS_IRQS; irq++) { 1199 1529 if (irq <= IRQ_CORETMR) { 1200 1530 irq_set_chip_and_handler(irq, &bfin_core_irqchip, ··· 1190 1546 if (irq == IRQ_CORETMR) 1191 1547 irq_set_handler(irq, handle_percpu_irq); 1192 1548 #endif 1193 - } else if (irq >= BFIN_IRQ(21) && irq <= BFIN_IRQ(26)) { 1194 - irq_set_chip(irq, &bfin_sec_irqchip); 1195 - irq_set_chained_handler(irq, bfin_demux_gpio_irq); 1196 1549 } else if (irq >= BFIN_IRQ(34) && irq <= BFIN_IRQ(37)) { 1197 1550 irq_set_chip_and_handler(irq, &bfin_sec_irqchip, 1198 1551 handle_percpu_irq); ··· 1204 1563 __irq_set_preflow_handler(irq, bfin_sec_preflow_handler); 1205 1564 } 1206 1565 } 1207 - for (irq = GPIO_IRQ_BASE; 1208 - irq < (GPIO_IRQ_BASE + MAX_BLACKFIN_GPIOS); irq++) 1209 - irq_set_chip_and_handler(irq, &bfin_gpio_irqchip, 1210 - handle_level_irq); 1211 1566 1212 1567 bfin_write_IMASK(0); 1213 1568 CSYNC();
+11 -11
arch/blackfin/mach-common/pm.c
··· 27 27 28 28 void bfin_pm_suspend_standby_enter(void) 29 29 { 30 - #ifndef CONFIG_BF60x 30 + #if !BFIN_GPIO_PINT 31 31 bfin_pm_standby_setup(); 32 32 #endif 33 33 ··· 41 41 # endif 42 42 #endif 43 43 44 - #ifndef CONFIG_BF60x 44 + #if !BFIN_GPIO_PINT 45 45 bfin_pm_standby_restore(); 46 46 #endif 47 47 ··· 128 128 if ((status & 0x3) != 0x3) 129 129 continue; 130 130 131 + 131 132 /* construct the address using the tag */ 132 133 addr = (status & 0xFFFFC800) | (subbank << 12) | (set << 5); 133 134 ··· 141 140 142 141 int bfin_pm_suspend_mem_enter(void) 143 142 { 144 - int wakeup, ret; 143 + int ret; 144 + #ifndef CONFIG_BF60x 145 + int wakeup; 146 + #endif 145 147 146 148 unsigned char *memptr = kmalloc(L1_CODE_LENGTH + L1_DATA_A_LENGTH 147 149 + L1_DATA_B_LENGTH + L1_SCRATCH_LENGTH, 148 - GFP_KERNEL); 150 + GFP_ATOMIC); 149 151 150 152 if (memptr == NULL) { 151 153 panic("bf53x_suspend_l1_mem malloc failed"); ··· 174 170 return ret; 175 171 } 176 172 173 + #ifdef CONFIG_GPIO_ADI 177 174 bfin_gpio_pm_hibernate_suspend(); 178 - 179 - #if BFIN_GPIO_PINT 180 - bfin_pint_suspend(); 181 175 #endif 182 176 183 177 #if defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK) ··· 196 194 _enable_icplb(); 197 195 _enable_dcplb(); 198 196 199 - #if BFIN_GPIO_PINT 200 - bfin_pint_resume(); 201 - #endif 202 - 197 + #ifdef CONFIG_GPIO_ADI 203 198 bfin_gpio_pm_hibernate_restore(); 199 + #endif 204 200 blackfin_dma_resume(); 205 201 206 202 kfree(memptr);
+8 -4
arch/blackfin/mach-common/smp.c
··· 146 146 147 147 platform_clear_ipi(cpu, IRQ_SUPPLE_1); 148 148 149 + smp_rmb(); 149 150 bfin_ipi_data = &__get_cpu_var(bfin_ipi); 150 151 while ((pending = atomic_xchg(&bfin_ipi_data->bits, 0)) != 0) { 151 152 msg = 0; ··· 162 161 case BFIN_IPI_CALL_FUNC: 163 162 generic_smp_call_function_interrupt(); 164 163 break; 165 - 166 164 case BFIN_IPI_CALL_FUNC_SINGLE: 167 165 generic_smp_call_function_single_interrupt(); 168 166 break; 169 - 170 167 case BFIN_IPI_CPU_STOP: 171 168 ipi_cpu_stop(cpu); 172 169 break; 170 + default: 171 + goto out; 173 172 } 174 173 atomic_dec(&bfin_ipi_data->count); 175 174 } while (msg < BITS_PER_LONG); 175 + 176 176 } 177 + out: 177 178 return IRQ_HANDLED; 178 179 } 179 180 ··· 201 198 bfin_ipi_data = &per_cpu(bfin_ipi, cpu); 202 199 atomic_set_mask((1 << msg), &bfin_ipi_data->bits); 203 200 atomic_inc(&bfin_ipi_data->count); 204 - platform_send_ipi_cpu(cpu, IRQ_SUPPLE_1); 205 201 } 206 - 207 202 local_irq_restore(flags); 203 + smp_wmb(); 204 + for_each_cpu(cpu, cpumask) 205 + platform_send_ipi_cpu(cpu, IRQ_SUPPLE_1); 208 206 } 209 207 210 208 void arch_send_call_function_single_ipi(int cpu)