0025-bcm2835-Add-support-for-uart1.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From 0b7e0b20da67546344f9fc8e57699adfe61b8953 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
  3. Date: Sat, 15 Aug 2015 20:50:02 +0200
  4. Subject: [PATCH 025/381] bcm2835: Add support for uart1
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. This is a hack until a proper solution is agreed upon.
  9. Martin Sperl is doing some work in this area.
  10. Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
  11. ---
  12. arch/arm/mach-bcm/board_bcm2835.c | 25 +++++++++++++++++++++++++
  13. 1 file changed, 25 insertions(+)
  14. --- a/arch/arm/mach-bcm/board_bcm2835.c
  15. +++ b/arch/arm/mach-bcm/board_bcm2835.c
  16. @@ -22,6 +22,29 @@
  17. #include <asm/mach/arch.h>
  18. #include <asm/mach/map.h>
  19. +/* Use this hack until a proper solution is agreed upon */
  20. +static void __init bcm2835_init_uart1(void)
  21. +{
  22. + struct device_node *np;
  23. +
  24. + np = of_find_compatible_node(NULL, NULL, "brcm,bcm2835-aux-uart");
  25. + if (of_device_is_available(np)) {
  26. + np = of_find_compatible_node(NULL, NULL,
  27. + "bcrm,bcm2835-aux-enable");
  28. + if (np) {
  29. + void __iomem *base = of_iomap(np, 0);
  30. +
  31. + if (!base) {
  32. + pr_err("bcm2835: Failed enabling Mini UART\n");
  33. + return;
  34. + }
  35. +
  36. + writel(1, base);
  37. + pr_info("bcm2835: Mini UART enabled\n");
  38. + }
  39. + }
  40. +}
  41. +
  42. static void __init bcm2835_init(void)
  43. {
  44. struct device_node *np = of_find_node_by_path("/system");
  45. @@ -42,6 +65,8 @@ static void __init bcm2835_init(void)
  46. system_rev = val;
  47. if (!of_property_read_u64(np, "linux,serial", &val64))
  48. system_serial_low = val64;
  49. +
  50. + bcm2835_init_uart1();
  51. }
  52. static const char * const bcm2835_compat[] = {