Skip to content

Commit

Permalink
3.8: implement PRU based PWM
Browse files Browse the repository at this point in the history
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
  • Loading branch information
koenkooi committed Jul 16, 2013
1 parent d9c49a7 commit 5b570d7
Show file tree
Hide file tree
Showing 4 changed files with 1,223 additions and 0 deletions.
@@ -0,0 +1,238 @@
From 06650b1a55e722c00d21402eceb5c1de12bf35d7 Mon Sep 17 00:00:00 2001
From: Pantelis Antoniou <panto@antoniou-consulting.com>
Date: Mon, 15 Jul 2013 23:00:35 +0300
Subject: [PATCH 5/5] capes: BACON Educational cape with free form muxing

---
firmware/Makefile | 3 +-
firmware/capes/BB-BONE-BACONE2-00A0.dts | 204 ++++++++++++++++++++++++++++++++
2 files changed, 206 insertions(+), 1 deletion(-)
create mode 100644 firmware/capes/BB-BONE-BACONE2-00A0.dts

diff --git a/firmware/Makefile b/firmware/Makefile
index d2c6161..cea34e6 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -188,7 +188,8 @@ fw-shipped-$(CONFIG_CAPE_BEAGLEBONE) += \
TT3201-001-01.dtbo \
BB-BONE-SERL-03-00A1.dtbo \
BB-BONE-BACON-00A0.dtbo \
- BB-BONE-BACONE-00A0.dtbo
+ BB-BONE-BACONE-00A0.dtbo \
+ BB-BONE-BACONE2-00A0.dtbo

# the geiger cape
fw-shipped-$(CONFIG_CAPE_BEAGLEBONE_GEIGER) += \
diff --git a/firmware/capes/BB-BONE-BACONE2-00A0.dts b/firmware/capes/BB-BONE-BACONE2-00A0.dts
new file mode 100644
index 0000000..5118f71
--- /dev/null
+++ b/firmware/capes/BB-BONE-BACONE2-00A0.dts
@@ -0,0 +1,204 @@
+/*
+ * Copyright (C) 2013 Circuit Co.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+/dts-v1/;
+/plugin/;
+
+/ {
+ compatible = "ti,beaglebone", "ti,beaglebone-black";
+
+ /* identification */
+ part-number = "BB-BONE-BACONE2";
+
+ /* state the resources this cape uses */
+ exclusive-use =
+ /* the pin header uses */
+ "P9.36", /* AIN5 */
+ "P8.19", /* gpio-keys: gpio0_23 */
+ "P9.14", /* pwm: ehrpwm1A */
+ "P9.16", /* pwm: ehrpwm1B */
+ "P9.42", /* pwm: eCAP0_in_PWM0_out */
+ "P9.17", /* shift: gpio0_5 LATCH */
+ "P9.18", /* shift: gpio0_4 SERIAL */
+ "P9.22", /* shift: gpio0_2 CLOCK */
+ /* the hardware IP uses */
+ "tscadc",
+ "gpio0_23",
+ "ehrpwm1A",
+ "ehrpwm1B",
+ "eCAP0_in_PWM0_out",
+ "gpio0_5",
+ "gpio0_4",
+ "gpio0_2";
+
+ fragment@0 {
+ target = <&am33xx_pinmux>;
+ __overlay__ {
+
+ bacon_ehrpwm1_pins: pinmux_bacon_ehrpwm1_pins {
+ pinctrl-single,pins = <
+ 0x048 0x6 /* P9_14 (ZCZ ball U14) | MODE 6 */
+ 0x04c 0x6 /* P9_16 (ZCZ ball T14) | MODE 6 */
+ >;
+ };
+
+ bacon_ecap0_pins: pinmux_bacon_ecap0_pins {
+ pinctrl-single,pins = <
+ 0x164 0x0 /* P9_42 (ZCZ ball C18) | MODE 0 */
+ >;
+ };
+
+ bacon_gpiohelp_pins: pinmux_bacon_gpio_helper_pins {
+ pinctrl-single,pins = <
+ 0x020 0x2f /* gpmc_ad8.gpio0_22, INPUT | PULLDIS | MODE7 */
+ >;
+ };
+
+ bacon_LATCH_in_pins: pinmux_bacon_LATCH_in_pins {
+ pinctrl-single,pins = <
+ 0x15c 0x0f /* P9 17 spi0_cs0.gpio0_5 | MODE7 | OUTPUT */
+ >;
+ };
+
+ bacon_LATCH_out_pins: pinmux_bacon_LATCH_out_pins {
+ pinctrl-single,pins = <
+ 0x15c 0x2f /* P9 17 spi0_cs0.gpio0_5 | MODE7 | PULLDIS | INPUT */
+ >;
+ };
+
+ bacon_SERIAL_in_pins: pinmux_bacon_SERIAL_in_pins {
+ pinctrl-single,pins = <
+ 0x158 0x2f /* P9 18 spi0_d1.gpio0_4 | MODE7 | PULLDIS | INPUT */
+ >;
+ };
+
+ bacon_SERIAL_out_pins: pinmux_bacon_SERIAL_out_pins {
+ pinctrl-single,pins = <
+ 0x158 0x0f /* P9 18 spi0_d1.gpio0_4 | MODE7 | OUTPUT */
+ >;
+ };
+
+ bacon_CLOCK_in_pins: pinmux_bacon_CLOCK_in_pins {
+ pinctrl-single,pins = <
+ 0x150 0x2f /* P9 22 spi0_sclk.gpio0_2 | MODE7 | PULLDIS | INPUT */
+ >;
+ };
+
+ bacon_CLOCK_out_pins: pinmux_bacon_CLOCK_out_pins {
+ pinctrl-single,pins = <
+ 0x150 0x0f /* P9 22 spi0_sclk.gpio0_2 | MODE7 | OUTPUT */
+ >;
+ };
+ };
+ };
+
+ fragment@1 {
+ target = <&ocp>;
+ __overlay__ {
+ /* avoid stupid warning */
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ tscadc {
+ compatible = "ti,ti-tscadc";
+ reg = <0x44e0d000 0x1000>;
+
+ interrupt-parent = <&intc>;
+ interrupts = <16>;
+ ti,hwmods = "adc_tsc";
+ status = "okay";
+
+ adc {
+ ti,adc-channels = <0 1 2 3 4 5 6 7>; /* 8 channels (but only #5 is used) */
+ };
+ };
+
+ bacon_adc_helper {
+ compatible = "bone-iio-helper";
+ vsense-name = "AIN0", "AIN1", "AIN2", "AIN3", "AIN4", "AIN5", "AIN6", "AIN7";
+ /* report micro-volts */
+ vsense-scale = <100000 100000 100000 100000 100000 100000 100000 100000>;
+ status = "okay";
+ };
+ };
+ };
+
+ fragment@3 {
+ target = <&epwmss0>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@4 {
+ target = <&ecap0>;
+ __overlay__ {
+ pinctrl-names = "default";
+ pinctrl-0 = <&bacon_ecap0_pins>;
+ status = "okay";
+ };
+ };
+
+ fragment@5 {
+ target = <&epwmss1>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@6 {
+ target = <&ehrpwm1>;
+ __overlay__ {
+ pinctrl-names = "default";
+ pinctrl-0 = <&bacon_ehrpwm1_pins>;
+ status = "okay";
+ };
+ };
+
+ fragment@8 {
+ target = <&ocp>;
+ __overlay__ {
+
+ LATCH_helper {
+ compatible = "bone-pinmux-helper";
+ status = "okay";
+ pinctrl-names = "in", "out";
+ pinctrl-0 = <&bacon_LATCH_in_pins>;
+ pinctrl-1 = <&bacon_LATCH_out_pins>;
+ };
+
+ SERIAL_helper {
+ compatible = "bone-pinmux-helper";
+ status = "okay";
+ pinctrl-names = "in", "out";
+ pinctrl-0 = <&bacon_SERIAL_in_pins>;
+ pinctrl-1 = <&bacon_SERIAL_out_pins>;
+ };
+
+ CLOCK_helper {
+ compatible = "bone-pinmux-helper";
+ status = "okay";
+ pinctrl-names = "in", "out";
+ pinctrl-0 = <&bacon_CLOCK_in_pins>;
+ pinctrl-1 = <&bacon_CLOCK_out_pins>;
+ };
+
+ bacon_gpiohelp {
+ compatible = "gpio-of-helper";
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&bacon_gpiohelp_pins>;
+
+ BUTTON {
+ gpio-name = "BUTTON";
+ gpio = <&gpio1 22 0x01>; /* gpio1 is gpio0 */
+ input;
+ };
+ };
+ };
+ };
+};
--
1.8.2.1

0 comments on commit 5b570d7

Please sign in to comment.