All of lore.kernel.org
 help / color / mirror / Atom feed
From: p.wilczek@samsung.com (Piotr Wilczek)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 8/8] board: add Samsung specific board support
Date: Wed, 11 Dec 2013 14:07:39 +0100	[thread overview]
Message-ID: <1386767259-15693-9-git-send-email-p.wilczek@samsung.com> (raw)
In-Reply-To: <1386767259-15693-1-git-send-email-p.wilczek@samsung.com>

Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 board-exynos.c                 |   77 ++++++++++++++++++++++++++++++++++++++++
 configs/Makefile.config.exynos |   13 +++++++
 2 files changed, 90 insertions(+)
 create mode 100644 board-exynos.c
 create mode 100644 configs/Makefile.config.exynos

diff --git a/board-exynos.c b/board-exynos.c
new file mode 100644
index 0000000..2769a5f
--- /dev/null
+++ b/board-exynos.c
@@ -0,0 +1,77 @@
+#include "atags.h"
+#include "board.h"
+#include "dtbs.h"
+#include "print.h"
+#include "register.h"
+#include "types.h"
+
+extern u32 _binary_input_zImage_start;
+extern u32 _binary_dtbs_bin_start;
+
+struct board board;
+
+#define EXYNOS_PRO_ID		0x10000000
+#define EXYNOS_PRO_ID_SHIFT	12
+
+struct exynos_board {
+	u32		proid;
+	u32		system_rev;
+	const char	*compatible;
+};
+
+static struct exynos_board exboards[] = {
+	/* Controller */
+	{
+		.proid		= 0xe4412,
+		.system_rev	= 0,
+		.compatible	= "samsung,trats2",
+	},
+	{
+		.proid		= 0x43210,
+		.system_rev	= 0,
+		.compatible	= "samsung,trats",
+	},
+	{ 0, 0, NULL }	/* sentinel */
+};
+
+static void panic(void)
+{
+	while (1)
+		;
+}
+
+static u32 get_proid()
+{
+	return readl(EXYNOS_PRO_ID) >> EXYNOS_PRO_ID_SHIFT;
+}
+
+struct board *match_board(u32 machid, const struct tag *tags)
+{
+	struct exynos_board *exboard;
+	u32 proid;
+
+	proid = get_proid();
+
+	for (exboard = exboards; exboard->proid; exboard++) {
+		if (exboard->proid == proid)
+			break;
+	}
+
+	if (exboard->compatible == NULL) {
+		putstr("ERROR MATCHING BOARD!\n");
+		panic(); /* doesn't return */
+	}
+
+	board.kernel = &_binary_input_zImage_start;
+	board.compatible = exboard->compatible;
+	board.dtb = find_dtb(&_binary_dtbs_bin_start, exboard->compatible);
+
+	if (board.dtb == NULL) {
+		putstr("NO DTB BLOB FOUND FOR ");
+		putstr(exboard->compatible);
+		putstr("\n");
+		panic(); /* doesn't return */
+	}
+
+	return &board;
+}
diff --git a/configs/Makefile.config.exynos b/configs/Makefile.config.exynos
new file mode 100644
index 0000000..af5ae53
--- /dev/null
+++ b/configs/Makefile.config.exynos
@@ -0,0 +1,13 @@
+# config for Exynos boards
+
+CROSS_COMPILE=arm-linux-gnueabi-
+MFG=exynos
+UART=exynos
+UART_PORT=2
+BINFMT=elf32-littlearm
+LOADADDR=0x41008000
+UART_BASE=0x40100000
+APPEND_KERNEL=input/zImage
+APPEND_DTBS=input/exynos4210-trats.dtb input/exynos4412-trats2.dtb
+
+NR_BANKS=8
\ No newline at end of file
-- 
1.7.9.5

  parent reply	other threads:[~2013-12-11 13:07 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 13:07 [PATCH 0/8] Impedance matcher for Samsung boards Piotr Wilczek
2013-12-11 13:07 ` [PATCH 1/8] registers: add write u8 type Piotr Wilczek
2013-12-11 13:07 ` [PATCH 2/8] string: fix strncmp function Piotr Wilczek
2013-12-11 13:07 ` [PATCH 3/8] device tree blob must be 4-bytes alingned Piotr Wilczek
2013-12-11 13:07 ` [PATCH 4/8] Makefile: disable generating Thumb code Piotr Wilczek
2013-12-11 13:07 ` [PATCH 5/8] add memory operations Piotr Wilczek
2013-12-11 13:07 ` [PATCH 7/8] serial: add Exynos specific serial driver Piotr Wilczek
2013-12-11 13:07 ` Piotr Wilczek [this message]
2013-12-11 13:16 ` [PATCH 0/8] Impedance matcher for Samsung boards Daniel Mack
2013-12-11 14:03   ` Piotr Wilczek
2013-12-11 14:10     ` Daniel Mack
2013-12-11 14:28       ` Tomasz Figa
2013-12-11 15:19         ` Daniel Mack
2013-12-11 15:48           ` Nicolas Pitre
2013-12-11 19:06           ` Jason Cooper
     [not found] ` <1386767259-15693-7-git-send-email-p.wilczek@samsung.com>
2013-12-11 19:00   ` [PATCH 6/8] add support to supplement atags to device tree Jason Cooper
2013-12-12 12:09     ` Piotr Wilczek
2013-12-12 12:36       ` Jason Cooper
2013-12-18 12:09 ` [PATCH V2 0/8] Impedance matcher for Samsung boards Piotr Wilczek
2013-12-18 12:09   ` [PATCH V2 1/8] registers: add write u8 type Piotr Wilczek
2013-12-18 12:09   ` [PATCH V2 2/8] string: fix strncmp function Piotr Wilczek
2013-12-18 12:15     ` Russell King - ARM Linux
2013-12-18 12:23       ` Daniel Mack
2013-12-18 12:52         ` Russell King - ARM Linux
2013-12-18 16:01           ` Jason Cooper
2013-12-18 18:50             ` Jason Cooper
2013-12-18 18:56             ` Jason Cooper
2013-12-18 16:03         ` Jason Cooper
2013-12-18 16:04           ` Daniel Mack
2013-12-18 12:50       ` Piotr Wilczek
2013-12-18 12:09   ` [PATCH V2 3/8] device tree blob must be 4-bytes alingned Piotr Wilczek
2013-12-18 12:09   ` [PATCH V2 4/8] Makefile: disable generating Thumb code Piotr Wilczek
2013-12-18 12:09   ` [PATCH V2 5/8] add memory operations Piotr Wilczek
2013-12-18 12:09   ` [PATCH V2 7/8] serial: add Exynos specific serial driver Piotr Wilczek
2013-12-18 12:09   ` [PATCH V2 8/8] board: add Samsung specific board support Piotr Wilczek

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=1386767259-15693-9-git-send-email-p.wilczek@samsung.com \
    --to=p.wilczek@samsung.com \
    --cc=linux-arm-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.