0005-grasshopper-usart.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig
  2. --- linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig 2016-09-20 11:43:03.645251779 +0200
  3. +++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig 2016-09-20 11:58:20.129642638 +0200
  4. @@ -49,4 +49,21 @@
  5. depends on I2C && I2C_GPIO
  6. default y
  7. +config BOARD_GRASSHOPPER_USART0
  8. + bool "Enable USART0"
  9. + depends on SERIAL_ATMEL_PDC
  10. + default n
  11. + help
  12. + USART0 is mapped to /dev/ttyS1 (or /dev/ttyAT1 resp.) and available via
  13. + connector J6 and J13.
  14. +
  15. +config BOARD_GRASSHOPPER_USART1
  16. + bool "Enable USART1 (CP2102 USB-Interface)"
  17. + depends on SERIAL_ATMEL_PDC
  18. + default y
  19. + help
  20. + USART1 is mapped to /dev/ttyS0 (or /dev/ttyAT0 resp.) and available via
  21. + the CP2002 USB-USART-bridge. If you disable this option, you won't be
  22. + able to access the serial console, so it is recommended to say 'y' here.
  23. +
  24. endif # BOARD_GRASSHOPPER
  25. diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/setup.c linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c
  26. --- linux-4.7.3/arch/avr32/boards/grasshopper/setup.c 2016-09-20 11:43:03.646251793 +0200
  27. +++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/setup.c 2016-09-20 12:03:04.864496603 +0200
  28. @@ -166,7 +166,12 @@
  29. void __init setup_board(void)
  30. {
  31. +#ifdef CONFIG_BOARD_GRASSHOPPER_USART1
  32. at32_map_usart(1, 0, 0); // USART 1: /dev/ttyS0, CP2102
  33. +#endif
  34. +#ifdef CONFIG_BOARD_GRASSHOPPER_USART0
  35. + at32_map_usart(0, 1, 0); // USART 0: /dev/ttyS1
  36. +#endif
  37. at32_setup_serial_console(0);
  38. // grasshopper_add_spi();
  39. @@ -182,7 +187,12 @@
  40. */
  41. at32_reserve_pin(GPIO_PIOE_BASE, ATMEL_EBI_PE_DATA_ALL);
  42. at32_add_device_usba(0, NULL);
  43. +#ifdef CONFIG_BOARD_GRASSHOPPER_USART1
  44. at32_add_device_usart(0);
  45. +#endif
  46. +#ifdef CONFIG_BOARD_GRASSHOPPER_USART0
  47. + at32_add_device_usart(1);
  48. +#endif
  49. #ifdef CONFIG_GRASSHOPPER_LCD
  50. at32_add_device_lcdc(0, &grasshopper_lcdc_data,