Skip to content

Commit

Permalink
bcm2835: Add support for uart1
Browse files Browse the repository at this point in the history
This is a hack until a proper solution is agreed upon.
Martin Sperl is doing some work in this area.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
  • Loading branch information
notro committed Aug 15, 2015
1 parent b02f42c commit eb9b4b1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/arm/boot/dts/bcm2835.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
arm-pmu {
compatible = "arm,arm1176-pmu";
};

aux_enable: aux_enable@0x7e215004 {
compatible = "bcrm,bcm2835-aux-enable";
reg = <0x7e215004 0x04>;
};
};
};

Expand Down
25 changes: 25 additions & 0 deletions arch/arm/mach-bcm/board_bcm2835.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,29 @@
#include <asm/mach/arch.h>
#include <asm/mach/map.h>

/* Use this hack until a proper solution is agreed upon */
static void __init bcm2835_init_uart1(void)
{
struct device_node *np;

np = of_find_compatible_node(NULL, NULL, "brcm,bcm2835-aux-uart");
if (of_device_is_available(np)) {
np = of_find_compatible_node(NULL, NULL,
"bcrm,bcm2835-aux-enable");
if (np) {
void __iomem *base = of_iomap(np, 0);

if (!base) {
pr_err("bcm2835: Failed enabling Mini UART\n");
return;
}

writel(1, base);
pr_info("bcm2835: Mini UART enabled\n");
}
}
}

static void __init bcm2835_init(void)
{
struct device_node *np = of_find_node_by_path("/system");
Expand All @@ -42,6 +65,8 @@ static void __init bcm2835_init(void)
system_rev = val;
if (!of_property_read_u64(np, "linux,serial", &val64))
system_serial_low = val64;

bcm2835_init_uart1();
}

static const char * const bcm2835_compat[] = {
Expand Down

0 comments on commit eb9b4b1

Please sign in to comment.