2 * GPIO Abstraction Layer
4 * Copyright 2006-2010 Analog Devices Inc.
6 * Licensed under the GPL-2 or later
10 #include <asm/errno.h>
12 #include <asm/portmux.h>
14 #if ANOMALY_05000311 || ANOMALY_05000323
17 AWA_data_clear = SYSCR,
21 AWA_maska_clear = UART_SCR,
22 AWA_maska_set = UART_SCR,
23 AWA_maska_toggle = UART_SCR,
24 AWA_maskb = UART_GCTL,
25 AWA_maskb_clear = UART_GCTL,
26 AWA_maskb_set = UART_GCTL,
27 AWA_maskb_toggle = UART_GCTL,
28 AWA_dir = SPORT1_STAT,
29 AWA_polar = SPORT1_STAT,
30 AWA_edge = SPORT1_STAT,
31 AWA_both = SPORT1_STAT,
33 AWA_inen = TIMER_ENABLE,
34 #elif ANOMALY_05000323
35 AWA_inen = DMA1_1_CONFIG,
38 /* Anomaly Workaround */
39 #define AWA_DUMMY_READ(name) bfin_read16(AWA_ ## name)
41 #define AWA_DUMMY_READ(...) do { } while (0)
44 static struct gpio_port_t * const gpio_array[] = {
45 #if defined(BF533_FAMILY)
46 (struct gpio_port_t *) FIO_FLAG_D,
47 #elif defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x) \
48 || defined(BF538_FAMILY)
49 (struct gpio_port_t *) PORTFIO,
50 # if !defined(BF538_FAMILY)
51 (struct gpio_port_t *) PORTGIO,
52 (struct gpio_port_t *) PORTHIO,
54 #elif defined(BF561_FAMILY)
55 (struct gpio_port_t *) FIO0_FLAG_D,
56 (struct gpio_port_t *) FIO1_FLAG_D,
57 (struct gpio_port_t *) FIO2_FLAG_D,
58 #elif defined(CONFIG_BF54x)
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 (struct gpio_port_t *)PORTH_FER,
67 (struct gpio_port_t *)PORTI_FER,
68 (struct gpio_port_t *)PORTJ_FER,
70 # error no gpio arrays defined
74 #if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
75 static unsigned short * const port_fer[] = {
76 (unsigned short *) PORTF_FER,
77 (unsigned short *) PORTG_FER,
78 (unsigned short *) PORTH_FER,
81 # if !defined(BF537_FAMILY)
82 static unsigned short * const port_mux[] = {
83 (unsigned short *) PORTF_MUX,
84 (unsigned short *) PORTG_MUX,
85 (unsigned short *) PORTH_MUX,
89 u8 pmux_offset[][16] = {
90 # if defined(CONFIG_BF52x)
91 { 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 4, 6, 8, 8, 10, 10 }, /* PORTF */
92 { 0, 0, 0, 0, 0, 2, 2, 4, 4, 6, 8, 10, 10, 10, 12, 12 }, /* PORTG */
93 { 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 4, 4, 4, 4, 4 }, /* PORTH */
94 # elif defined(CONFIG_BF51x)
95 { 0, 2, 2, 2, 2, 2, 2, 4, 6, 6, 6, 8, 8, 8, 8, 10 }, /* PORTF */
96 { 0, 0, 0, 2, 4, 6, 6, 6, 8, 10, 10, 12, 14, 14, 14, 14 }, /* PORTG */
97 { 0, 0, 0, 0, 2, 2, 4, 6, 10, 10, 10, 10, 10, 10, 10, 10 }, /* PORTH */
102 #elif defined(BF538_FAMILY)
103 static unsigned short * const port_fer[] = {
104 (unsigned short *) PORTCIO_FER,
105 (unsigned short *) PORTDIO_FER,
106 (unsigned short *) PORTEIO_FER,
110 #ifdef CONFIG_BFIN_GPIO_TRACK
111 #define RESOURCE_LABEL_SIZE 16
113 static struct str_ident {
114 char name[RESOURCE_LABEL_SIZE];
115 } str_ident[MAX_RESOURCES];
117 static void gpio_error(unsigned gpio)
119 printf("bfin-gpio: GPIO %d wasn't requested!\n", gpio);
122 static void set_label(unsigned short ident, const char *label)
125 strncpy(str_ident[ident].name, label,
126 RESOURCE_LABEL_SIZE);
127 str_ident[ident].name[RESOURCE_LABEL_SIZE - 1] = 0;
131 static char *get_label(unsigned short ident)
133 return (*str_ident[ident].name ? str_ident[ident].name : "UNKNOWN");
136 static int cmp_label(unsigned short ident, const char *label)
139 printf("bfin-gpio: please provide none-null label\n");
142 return strcmp(str_ident[ident].name, label);
147 #define map_entry(m, i) reserved_##m##_map[gpio_bank(i)]
148 #define is_reserved(m, i, e) (map_entry(m, i) & gpio_bit(i))
149 #define reserve(m, i) (map_entry(m, i) |= gpio_bit(i))
150 #define unreserve(m, i) (map_entry(m, i) &= ~gpio_bit(i))
151 #define DECLARE_RESERVED_MAP(m, c) static unsigned short reserved_##m##_map[c]
153 #define is_reserved(m, i, e) (!(e))
154 #define reserve(m, i)
155 #define unreserve(m, i)
156 #define DECLARE_RESERVED_MAP(m, c)
157 #define gpio_error(gpio)
158 #define set_label(...)
159 #define get_label(...) ""
160 #define cmp_label(...) 1
163 DECLARE_RESERVED_MAP(gpio, GPIO_BANK_NUM);
164 DECLARE_RESERVED_MAP(peri, gpio_bank(MAX_RESOURCES));
166 inline int check_gpio(unsigned gpio)
168 #if defined(CONFIG_BF54x)
169 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15
170 || gpio == GPIO_PH14 || gpio == GPIO_PH15
171 || gpio == GPIO_PJ14 || gpio == GPIO_PJ15)
174 if (gpio >= MAX_BLACKFIN_GPIOS)
179 static void port_setup(unsigned gpio, unsigned short usage)
181 #if defined(BF538_FAMILY)
183 * BF538/9 Port C,D and E are special.
184 * Inverted PORT_FER polarity on CDE and no PORF_FER on F
185 * Regular PORT F GPIOs are handled here, CDE are exclusively
189 if (gpio < MAX_BLACKFIN_GPIOS || gpio >= MAX_RESOURCES)
192 gpio -= MAX_BLACKFIN_GPIOS;
194 if (usage == GPIO_USAGE)
195 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio);
197 *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio);
202 if (check_gpio(gpio))
205 #if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
206 if (usage == GPIO_USAGE)
207 *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio);
209 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio);
211 #elif defined(CONFIG_BF54x)
212 if (usage == GPIO_USAGE)
213 gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio);
215 gpio_array[gpio_bank(gpio)]->port_fer |= gpio_bit(gpio);
223 unsigned short offset;
225 {.res = P_PPI0_D13, .offset = 11},
226 {.res = P_PPI0_D14, .offset = 11},
227 {.res = P_PPI0_D15, .offset = 11},
228 {.res = P_SPORT1_TFS, .offset = 11},
229 {.res = P_SPORT1_TSCLK, .offset = 11},
230 {.res = P_SPORT1_DTPRI, .offset = 11},
231 {.res = P_PPI0_D10, .offset = 10},
232 {.res = P_PPI0_D11, .offset = 10},
233 {.res = P_PPI0_D12, .offset = 10},
234 {.res = P_SPORT1_RSCLK, .offset = 10},
235 {.res = P_SPORT1_RFS, .offset = 10},
236 {.res = P_SPORT1_DRPRI, .offset = 10},
237 {.res = P_PPI0_D8, .offset = 9},
238 {.res = P_PPI0_D9, .offset = 9},
239 {.res = P_SPORT1_DRSEC, .offset = 9},
240 {.res = P_SPORT1_DTSEC, .offset = 9},
241 {.res = P_TMR2, .offset = 8},
242 {.res = P_PPI0_FS3, .offset = 8},
243 {.res = P_TMR3, .offset = 7},
244 {.res = P_SPI0_SSEL4, .offset = 7},
245 {.res = P_TMR4, .offset = 6},
246 {.res = P_SPI0_SSEL5, .offset = 6},
247 {.res = P_TMR5, .offset = 5},
248 {.res = P_SPI0_SSEL6, .offset = 5},
249 {.res = P_UART1_RX, .offset = 4},
250 {.res = P_UART1_TX, .offset = 4},
251 {.res = P_TMR6, .offset = 4},
252 {.res = P_TMR7, .offset = 4},
253 {.res = P_UART0_RX, .offset = 3},
254 {.res = P_UART0_TX, .offset = 3},
255 {.res = P_DMAR0, .offset = 3},
256 {.res = P_DMAR1, .offset = 3},
257 {.res = P_SPORT0_DTSEC, .offset = 1},
258 {.res = P_SPORT0_DRSEC, .offset = 1},
259 {.res = P_CAN0_RX, .offset = 1},
260 {.res = P_CAN0_TX, .offset = 1},
261 {.res = P_SPI0_SSEL7, .offset = 1},
262 {.res = P_SPORT0_TFS, .offset = 0},
263 {.res = P_SPORT0_DTPRI, .offset = 0},
264 {.res = P_SPI0_SSEL2, .offset = 0},
265 {.res = P_SPI0_SSEL3, .offset = 0},
268 static void portmux_setup(unsigned short per)
270 u16 y, offset, muxreg;
271 u16 function = P_FUNCT2MUX(per);
273 for (y = 0; y < ARRAY_SIZE(port_mux_lut); y++) {
274 if (port_mux_lut[y].res == per) {
276 /* SET PORTMUX REG */
278 offset = port_mux_lut[y].offset;
279 muxreg = bfin_read_PORT_MUX();
282 muxreg &= ~(1 << offset);
286 muxreg |= (function << offset);
287 bfin_write_PORT_MUX(muxreg);
291 #elif defined(CONFIG_BF54x)
292 inline void portmux_setup(unsigned short per)
295 u16 ident = P_IDENT(per);
296 u16 function = P_FUNCT2MUX(per);
298 pmux = gpio_array[gpio_bank(ident)]->port_mux;
300 pmux &= ~(0x3 << (2 * gpio_sub_n(ident)));
301 pmux |= (function & 0x3) << (2 * gpio_sub_n(ident));
303 gpio_array[gpio_bank(ident)]->port_mux = pmux;
306 inline u16 get_portmux(unsigned short per)
309 u16 ident = P_IDENT(per);
311 pmux = gpio_array[gpio_bank(ident)]->port_mux;
313 return (pmux >> (2 * gpio_sub_n(ident)) & 0x3);
315 #elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
316 inline void portmux_setup(unsigned short per)
318 u16 pmux, ident = P_IDENT(per), function = P_FUNCT2MUX(per);
319 u8 offset = pmux_offset[gpio_bank(ident)][gpio_sub_n(ident)];
321 pmux = *port_mux[gpio_bank(ident)];
322 pmux &= ~(3 << offset);
323 pmux |= (function & 3) << offset;
324 *port_mux[gpio_bank(ident)] = pmux;
328 # define portmux_setup(...) do { } while (0)
332 /***********************************************************
334 * FUNCTIONS: Blackfin General Purpose Ports Access Functions
337 * gpio - GPIO Number between 0 and MAX_BLACKFIN_GPIOS
340 * DESCRIPTION: These functions abstract direct register access
341 * to Blackfin processor General Purpose
344 * CAUTION: These functions do not belong to the GPIO Driver API
345 *************************************************************
346 * MODIFICATION HISTORY :
347 **************************************************************/
349 /* Set a specific bit */
351 #define SET_GPIO(name) \
352 void set_gpio_ ## name(unsigned gpio, unsigned short arg) \
354 unsigned long flags; \
355 local_irq_save(flags); \
357 gpio_array[gpio_bank(gpio)]->name |= gpio_bit(gpio); \
359 gpio_array[gpio_bank(gpio)]->name &= ~gpio_bit(gpio); \
360 AWA_DUMMY_READ(name); \
361 local_irq_restore(flags); \
364 SET_GPIO(dir) /* set_gpio_dir() */
365 SET_GPIO(inen) /* set_gpio_inen() */
366 SET_GPIO(polar) /* set_gpio_polar() */
367 SET_GPIO(edge) /* set_gpio_edge() */
368 SET_GPIO(both) /* set_gpio_both() */
371 #define SET_GPIO_SC(name) \
372 void set_gpio_ ## name(unsigned gpio, unsigned short arg) \
374 unsigned long flags; \
375 if (ANOMALY_05000311 || ANOMALY_05000323) \
376 local_irq_save(flags); \
378 gpio_array[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \
380 gpio_array[gpio_bank(gpio)]->name ## _clear = gpio_bit(gpio); \
381 if (ANOMALY_05000311 || ANOMALY_05000323) { \
382 AWA_DUMMY_READ(name); \
383 local_irq_restore(flags); \
391 void set_gpio_toggle(unsigned gpio)
394 if (ANOMALY_05000311 || ANOMALY_05000323)
395 local_irq_save(flags);
396 gpio_array[gpio_bank(gpio)]->toggle = gpio_bit(gpio);
397 if (ANOMALY_05000311 || ANOMALY_05000323) {
398 AWA_DUMMY_READ(toggle);
399 local_irq_restore(flags);
403 /* Set current PORT date (16-bit word) */
405 #define SET_GPIO_P(name) \
406 void set_gpiop_ ## name(unsigned gpio, unsigned short arg) \
408 unsigned long flags; \
409 if (ANOMALY_05000311 || ANOMALY_05000323) \
410 local_irq_save(flags); \
411 gpio_array[gpio_bank(gpio)]->name = arg; \
412 if (ANOMALY_05000311 || ANOMALY_05000323) { \
413 AWA_DUMMY_READ(name); \
414 local_irq_restore(flags); \
427 /* Get a specific bit */
428 #define GET_GPIO(name) \
429 unsigned short get_gpio_ ## name(unsigned gpio) \
431 unsigned long flags; \
432 unsigned short ret; \
433 if (ANOMALY_05000311 || ANOMALY_05000323) \
434 local_irq_save(flags); \
435 ret = 0x01 & (gpio_array[gpio_bank(gpio)]->name >> gpio_sub_n(gpio)); \
436 if (ANOMALY_05000311 || ANOMALY_05000323) { \
437 AWA_DUMMY_READ(name); \
438 local_irq_restore(flags); \
452 /* Get current PORT date (16-bit word) */
454 #define GET_GPIO_P(name) \
455 unsigned short get_gpiop_ ## name(unsigned gpio) \
457 unsigned long flags; \
458 unsigned short ret; \
459 if (ANOMALY_05000311 || ANOMALY_05000323) \
460 local_irq_save(flags); \
461 ret = (gpio_array[gpio_bank(gpio)]->name); \
462 if (ANOMALY_05000311 || ANOMALY_05000323) { \
463 AWA_DUMMY_READ(name); \
464 local_irq_restore(flags); \
478 #else /* CONFIG_BF54x */
480 unsigned short get_gpio_dir(unsigned gpio)
482 return (0x01 & (gpio_array[gpio_bank(gpio)]->dir_clear >> gpio_sub_n(gpio)));
485 #endif /* CONFIG_BF54x */
487 /***********************************************************
489 * FUNCTIONS: Blackfin Peripheral Resource Allocation
493 * per Peripheral Identifier
496 * DESCRIPTION: Blackfin Peripheral Resource Allocation and Setup API
499 *************************************************************
500 * MODIFICATION HISTORY :
501 **************************************************************/
503 int peripheral_request(unsigned short per, const char *label)
505 unsigned short ident = P_IDENT(per);
508 * Don't cares are pins with only one dedicated function
511 if (per & P_DONTCARE)
514 if (!(per & P_DEFINED))
517 BUG_ON(ident >= MAX_RESOURCES);
519 /* If a pin can be muxed as either GPIO or peripheral, make
520 * sure it is not already a GPIO pin when we request it.
522 if (unlikely(!check_gpio(ident) && is_reserved(gpio, ident, 1))) {
523 printf("%s: Peripheral %d is already reserved as GPIO by %s !\n",
524 __func__, ident, get_label(ident));
528 if (unlikely(is_reserved(peri, ident, 1))) {
531 * Pin functions like AMC address strobes my
532 * be requested and used by several drivers
536 if (!((per & P_MAYSHARE) && get_portmux(per) == P_FUNCT2MUX(per))) {
538 if (!(per & P_MAYSHARE)) {
541 * Allow that the identical pin function can
542 * be requested from the same driver twice
545 if (cmp_label(ident, label) == 0)
548 printf("%s: Peripheral %d function %d is already reserved by %s !\n",
549 __func__, ident, P_FUNCT2MUX(per), get_label(ident));
555 reserve(peri, ident);
558 port_setup(ident, PERIPHERAL_USAGE);
560 set_label(ident, label);
565 int peripheral_request_list(const unsigned short per[], const char *label)
570 for (cnt = 0; per[cnt] != 0; cnt++) {
572 ret = peripheral_request(per[cnt], label);
575 for ( ; cnt > 0; cnt--)
576 peripheral_free(per[cnt - 1]);
585 void peripheral_free(unsigned short per)
587 unsigned short ident = P_IDENT(per);
589 if (per & P_DONTCARE)
592 if (!(per & P_DEFINED))
595 if (unlikely(!is_reserved(peri, ident, 0)))
598 if (!(per & P_MAYSHARE))
599 port_setup(ident, GPIO_USAGE);
601 unreserve(peri, ident);
603 set_label(ident, "free");
606 void peripheral_free_list(const unsigned short per[])
609 for (cnt = 0; per[cnt] != 0; cnt++)
610 peripheral_free(per[cnt]);
613 /***********************************************************
615 * FUNCTIONS: Blackfin GPIO Driver
618 * gpio PIO Number between 0 and MAX_BLACKFIN_GPIOS
621 * DESCRIPTION: Blackfin GPIO Driver API
624 *************************************************************
625 * MODIFICATION HISTORY :
626 **************************************************************/
628 int bfin_gpio_request(unsigned gpio, const char *label)
630 if (check_gpio(gpio) < 0)
634 * Allow that the identical GPIO can
635 * be requested from the same driver twice
636 * Do nothing and return -
639 if (cmp_label(gpio, label) == 0)
642 if (unlikely(is_reserved(gpio, gpio, 1))) {
643 printf("bfin-gpio: GPIO %d is already reserved by %s !\n",
644 gpio, get_label(gpio));
647 if (unlikely(is_reserved(peri, gpio, 1))) {
648 printf("bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n",
649 gpio, get_label(gpio));
653 else { /* Reset POLAR setting when acquiring a gpio for the first time */
654 set_gpio_polar(gpio, 0);
659 set_label(gpio, label);
661 port_setup(gpio, GPIO_USAGE);
666 void bfin_gpio_free(unsigned gpio)
668 if (check_gpio(gpio) < 0)
671 if (unlikely(!is_reserved(gpio, gpio, 0))) {
676 unreserve(gpio, gpio);
678 set_label(gpio, "free");
681 #ifdef BFIN_SPECIAL_GPIO_BANKS
682 DECLARE_RESERVED_MAP(special_gpio, gpio_bank(MAX_RESOURCES));
684 int bfin_special_gpio_request(unsigned gpio, const char *label)
687 * Allow that the identical GPIO can
688 * be requested from the same driver twice
689 * Do nothing and return -
692 if (cmp_label(gpio, label) == 0)
695 if (unlikely(is_reserved(special_gpio, gpio, 1))) {
696 printf("bfin-gpio: GPIO %d is already reserved by %s !\n",
697 gpio, get_label(gpio));
700 if (unlikely(is_reserved(peri, gpio, 1))) {
701 printf("bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n",
702 gpio, get_label(gpio));
707 reserve(special_gpio, gpio);
710 set_label(gpio, label);
711 port_setup(gpio, GPIO_USAGE);
716 void bfin_special_gpio_free(unsigned gpio)
718 if (unlikely(!is_reserved(special_gpio, gpio, 0))) {
723 reserve(special_gpio, gpio);
725 set_label(gpio, "free");
729 static inline void __bfin_gpio_direction_input(unsigned gpio)
732 gpio_array[gpio_bank(gpio)]->dir_clear = gpio_bit(gpio);
734 gpio_array[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio);
736 gpio_array[gpio_bank(gpio)]->inen |= gpio_bit(gpio);
739 int bfin_gpio_direction_input(unsigned gpio)
743 if (!is_reserved(gpio, gpio, 0)) {
748 local_irq_save(flags);
749 __bfin_gpio_direction_input(gpio);
750 AWA_DUMMY_READ(inen);
751 local_irq_restore(flags);
756 void bfin_gpio_toggle_value(unsigned gpio)
759 gpio_set_value(gpio, !gpio_get_value(gpio));
761 gpio_array[gpio_bank(gpio)]->toggle = gpio_bit(gpio);
765 void bfin_gpio_set_value(unsigned gpio, int arg)
768 gpio_array[gpio_bank(gpio)]->data_set = gpio_bit(gpio);
770 gpio_array[gpio_bank(gpio)]->data_clear = gpio_bit(gpio);
773 int bfin_gpio_direction_output(unsigned gpio, int value)
777 if (!is_reserved(gpio, gpio, 0)) {
782 local_irq_save(flags);
784 gpio_array[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio);
785 gpio_set_value(gpio, value);
787 gpio_array[gpio_bank(gpio)]->dir_set = gpio_bit(gpio);
789 gpio_array[gpio_bank(gpio)]->dir |= gpio_bit(gpio);
793 local_irq_restore(flags);
798 int bfin_gpio_get_value(unsigned gpio)
801 return (1 & (gpio_array[gpio_bank(gpio)]->data >> gpio_sub_n(gpio)));
805 if (unlikely(get_gpio_edge(gpio))) {
807 local_irq_save(flags);
808 set_gpio_edge(gpio, 0);
809 ret = get_gpio_data(gpio);
810 set_gpio_edge(gpio, 1);
811 local_irq_restore(flags);
814 return get_gpio_data(gpio);
818 /* If we are booting from SPI and our board lacks a strong enough pull up,
819 * the core can reset and execute the bootrom faster than the resistor can
820 * pull the signal logically high. To work around this (common) error in
821 * board design, we explicitly set the pin back to GPIO mode, force /CS
822 * high, and wait for the electrons to do their thing.
824 * This function only makes sense to be called from reset code, but it
825 * lives here as we need to force all the GPIO states w/out going through
826 * BUG() checks and such.
828 void bfin_reset_boot_spi_cs(unsigned short pin)
830 unsigned short gpio = P_IDENT(pin);
831 port_setup(gpio, GPIO_USAGE);
832 gpio_array[gpio_bank(gpio)]->data_set = gpio_bit(gpio);
833 AWA_DUMMY_READ(data_set);
837 #ifdef CONFIG_BFIN_GPIO_TRACK
838 void bfin_gpio_labels(void)
842 for (c = 0; c < MAX_RESOURCES; c++) {
843 gpio = is_reserved(gpio, c, 1);
844 if (!check_gpio(c) && gpio)
845 printf("GPIO_%d:\t%s\tGPIO %s\n", c,
847 get_gpio_dir(c) ? "OUTPUT" : "INPUT");
848 else if (is_reserved(peri, c, 1))
849 printf("GPIO_%d:\t%s\tPeripheral\n", c, get_label(c));