mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: yegorslists@googlemail.com
To: barebox@lists.infradead.org
Subject: [PATCH] arm: baltos: enable mPCIe slot and configure external GPIO controller
Date: Fri, 10 Mar 2017 09:58:20 +0100	[thread overview]
Message-ID: <1489136300-8428-1-git-send-email-yegorslists@googlemail.com> (raw)

From: Yegor Yefremov <yegorslists@googlemail.com>

Baltos devices provide a mPCIe slot, whose power is turned off by
default. This patch activates mPCIe slot in barebox, so that for example
GSM modem can be already available in user space.

Also configure external GPIO controller via setting its output pins to
low.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 arch/arm/boards/vscom-baltos/board.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/boards/vscom-baltos/board.c b/arch/arm/boards/vscom-baltos/board.c
index fea992d..39f40a6 100644
--- a/arch/arm/boards/vscom-baltos/board.c
+++ b/arch/arm/boards/vscom-baltos/board.c
@@ -41,6 +41,7 @@
 #include <linux/err.h>
 #include <mach/bbu.h>
 #include <libfile.h>
+#include <gpio.h>
 
 static struct omap_barebox_part baltos_barebox_part = {
 	.nand_offset = SZ_512K,
@@ -109,6 +110,17 @@ static int baltos_read_eeprom(void)
 	sprintf(var_buf, "%d", hw_param.SystemId);
 	globalvar_add_simple("board.id", var_buf);
 
+	/* enable mPCIe slot */
+	gpio_direction_output(100, 1);
+
+	/* configure output signals of the external GPIO controller */
+	if (hw_param.SystemId == 210 || hw_param.SystemId == 211) {
+		gpio_direction_output(132, 0);
+		gpio_direction_output(133, 0);
+		gpio_direction_output(134, 0);
+		gpio_direction_output(135, 0);
+	}
+
 	return 0;
 }
 environment_initcall(baltos_read_eeprom);
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2017-03-10  8:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10  8:58 yegorslists [this message]
2017-03-14  7:18 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1489136300-8428-1-git-send-email-yegorslists@googlemail.com \
    --to=yegorslists@googlemail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox