mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2 0/7] ARM: initial support for RC Module UEMD SoCs and MB 77.07 board
@ 2014-05-22 19:48 Antony Pavlov
  2014-05-22 19:48 ` [PATCH v2 1/7] ARM: initial support for RC Module UEMD SoCs Antony Pavlov
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Antony Pavlov @ 2014-05-22 19:48 UTC (permalink / raw)
  To: barebox

Research Centre "Module" (RC Module) is
a Russian development company designing
mixed-signal ASICs and real-time video-image
processing systems.

К1879ХБ1Я (AKA K1879HB1YA) is a UEMD family SoC that combines
a DSP core based on the NeuroMatrix(r) family
with an ARM architecture CPU ARM1176JZF-S core.

The MB 77.07 is a small (80x80 mm) single-board computer
developed in Russia by the RC Module.
It was developed as an educational board for К1879ХБ1Я SoC
capabilities demonstration.

See http://www.module.ru/en/catalog/micro/micro_pc/ for details.

Changes since v1:

  1. fix reset_cpu()
  2. fix pbl image build
  3. add usb support
  4. add uemd clocksource
  5. add mb7707 barebox mini-howto

Antony Pavlov (7):
  ARM: initial support for RC Module UEMD SoCs
  ARM: uemd: add DEBUG_LL support
  clocksource: add uemd clocksource
  ARM: dts: add minimal К1879ХБ1Я devicetree file
  ARM: uemd: add mb7707 board support
  ARM: uemd: add module-mb7707_defconfig
  ARM: mb7707: add barebox mini-howto

 arch/arm/Kconfig                                |  12 +++
 arch/arm/Makefile                               |   1 +
 arch/arm/boards/Makefile                        |   1 +
 arch/arm/boards/module-mb7707/Makefile          |   2 +
 arch/arm/boards/module-mb7707/board.c           |  43 ++++++++
 arch/arm/boards/module-mb7707/lowlevel.c        |  34 +++++++
 arch/arm/boards/module-mb7707/module-mb7707.dox |  29 ++++++
 arch/arm/configs/module-mb7707_defconfig        |  49 +++++++++
 arch/arm/dts/k1879hb1ya.dtsi                    |  37 +++++++
 arch/arm/dts/module-mb7707.dts                  |  24 +++++
 arch/arm/mach-uemd/Kconfig                      |  16 +++
 arch/arm/mach-uemd/Makefile                     |   1 +
 arch/arm/mach-uemd/include/mach/debug_ll.h      |  42 ++++++++
 arch/arm/mach-uemd/include/mach/hardware.h      |   7 ++
 arch/arm/mach-uemd/reset.c                      |  24 +++++
 drivers/clocksource/Kconfig                     |   4 +
 drivers/clocksource/Makefile                    |   1 +
 drivers/clocksource/uemd.c                      | 130 ++++++++++++++++++++++++
 18 files changed, 457 insertions(+)
 create mode 100644 arch/arm/boards/module-mb7707/Makefile
 create mode 100644 arch/arm/boards/module-mb7707/board.c
 create mode 100644 arch/arm/boards/module-mb7707/lowlevel.c
 create mode 100644 arch/arm/boards/module-mb7707/module-mb7707.dox
 create mode 100644 arch/arm/configs/module-mb7707_defconfig
 create mode 100644 arch/arm/dts/k1879hb1ya.dtsi
 create mode 100644 arch/arm/dts/module-mb7707.dts
 create mode 100644 arch/arm/mach-uemd/Kconfig
 create mode 100644 arch/arm/mach-uemd/Makefile
 create mode 100644 arch/arm/mach-uemd/include/mach/debug_ll.h
 create mode 100644 arch/arm/mach-uemd/include/mach/hardware.h
 create mode 100644 arch/arm/mach-uemd/reset.c
 create mode 100644 drivers/clocksource/uemd.c

-- 
1.9.2


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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 1/7] ARM: initial support for RC Module UEMD SoCs
  2014-05-22 19:48 [PATCH v2 0/7] ARM: initial support for RC Module UEMD SoCs and MB 77.07 board Antony Pavlov
@ 2014-05-22 19:48 ` Antony Pavlov
  2014-05-22 19:48 ` [PATCH v2 2/7] ARM: uemd: add DEBUG_LL support Antony Pavlov
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Antony Pavlov @ 2014-05-22 19:48 UTC (permalink / raw)
  To: barebox

This commit adds minimal support for the UEMD SoCs
from RC Module (http://www.module.ru).

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/arm/Kconfig                           | 11 +++++++++++
 arch/arm/Makefile                          |  1 +
 arch/arm/mach-uemd/Kconfig                 |  7 +++++++
 arch/arm/mach-uemd/Makefile                |  1 +
 arch/arm/mach-uemd/include/mach/hardware.h |  7 +++++++
 arch/arm/mach-uemd/reset.c                 | 24 ++++++++++++++++++++++++
 6 files changed, 51 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 38b100d..81ee19b 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -194,6 +194,16 @@ config ARCH_TEGRA
 	select RELOCATABLE
 	select RESET_CONTROLLER
 
+config ARCH_UEMD
+	bool "RC Module UEMD Platform"
+	select CPU_ARM1176
+	select COMMON_CLK
+	select COMMON_CLK_OF_PROVIDER
+	select CLKDEV_LOOKUP
+	select OFDEVICE
+	select OFTREE
+	select CLOCKSOURCE_UEMD
+
 config ARCH_ZYNQ
 	bool "Xilinx Zynq-based boards"
 	select HAS_DEBUG_LL
@@ -220,6 +230,7 @@ source arch/arm/mach-socfpga/Kconfig
 source arch/arm/mach-versatile/Kconfig
 source arch/arm/mach-vexpress/Kconfig
 source arch/arm/mach-tegra/Kconfig
+source arch/arm/mach-uemd/Kconfig
 source arch/arm/mach-zynq/Kconfig
 
 config ARM_ASM_UNIFIED
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index c576999..64db73c 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -70,6 +70,7 @@ machine-$(CONFIG_ARCH_SOCFPGA)		:= socfpga
 machine-$(CONFIG_ARCH_VERSATILE)	:= versatile
 machine-$(CONFIG_ARCH_VEXPRESS)		:= vexpress
 machine-$(CONFIG_ARCH_TEGRA)		:= tegra
+machine-$(CONFIG_ARCH_UEMD)		:= uemd
 machine-$(CONFIG_ARCH_ZYNQ)		:= zynq
 
 
diff --git a/arch/arm/mach-uemd/Kconfig b/arch/arm/mach-uemd/Kconfig
new file mode 100644
index 0000000..f9cf859
--- /dev/null
+++ b/arch/arm/mach-uemd/Kconfig
@@ -0,0 +1,7 @@
+if ARCH_UEMD
+
+config ARCH_TEXT_BASE
+	hex
+	default 0x40800000
+
+endif
diff --git a/arch/arm/mach-uemd/Makefile b/arch/arm/mach-uemd/Makefile
new file mode 100644
index 0000000..f3cc668
--- /dev/null
+++ b/arch/arm/mach-uemd/Makefile
@@ -0,0 +1 @@
+obj-y += reset.o
diff --git a/arch/arm/mach-uemd/include/mach/hardware.h b/arch/arm/mach-uemd/include/mach/hardware.h
new file mode 100644
index 0000000..2311ebf
--- /dev/null
+++ b/arch/arm/mach-uemd/include/mach/hardware.h
@@ -0,0 +1,7 @@
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+#define UEMD_EHCI_BASE	0x10040000
+#define UEMD_UART0_BASE	0x2002b000
+
+#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/mach-uemd/reset.c b/arch/arm/mach-uemd/reset.c
new file mode 100644
index 0000000..00ae0be
--- /dev/null
+++ b/arch/arm/mach-uemd/reset.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2014 Antony Pavlov <antonynpavlov@gmail.com>
+ *
+ * This file is part of barebox.
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <common.h>
+
+void __noreturn reset_cpu(ulong addr)
+{
+	hang();
+}
+EXPORT_SYMBOL(reset_cpu);
-- 
1.9.2


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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 2/7] ARM: uemd: add DEBUG_LL support
  2014-05-22 19:48 [PATCH v2 0/7] ARM: initial support for RC Module UEMD SoCs and MB 77.07 board Antony Pavlov
  2014-05-22 19:48 ` [PATCH v2 1/7] ARM: initial support for RC Module UEMD SoCs Antony Pavlov
@ 2014-05-22 19:48 ` Antony Pavlov
  2014-05-30  6:09   ` Holger Schurig
  2014-05-22 19:48 ` [PATCH v2 3/7] clocksource: add uemd clocksource Antony Pavlov
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 12+ messages in thread
From: Antony Pavlov @ 2014-05-22 19:48 UTC (permalink / raw)
  To: barebox

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/arm/Kconfig                           |  1 +
 arch/arm/mach-uemd/include/mach/debug_ll.h | 42 ++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 81ee19b..c236a9e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -203,6 +203,7 @@ config ARCH_UEMD
 	select OFDEVICE
 	select OFTREE
 	select CLOCKSOURCE_UEMD
+	select HAS_DEBUG_LL
 
 config ARCH_ZYNQ
 	bool "Xilinx Zynq-based boards"
diff --git a/arch/arm/mach-uemd/include/mach/debug_ll.h b/arch/arm/mach-uemd/include/mach/debug_ll.h
new file mode 100644
index 0000000..ce18244
--- /dev/null
+++ b/arch/arm/mach-uemd/include/mach/debug_ll.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2014 Antony Pavlov <antonynpavlov@gmail.com>
+ *
+ * This file is part of barebox.
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+/** @file
+ *  This File contains declaration for early output support
+ */
+#ifndef __INCLUDE_ARCH_DEBUG_LL_H__
+#define __INCLUDE_ARCH_DEBUG_LL_H__
+
+#include <asm/io.h>
+#include <mach/hardware.h>
+
+#define DEBUG_LL_UART_ADDR	UEMD_UART0_BASE
+#define DEBUG_LL_UART_RSHFT	2
+
+#define rbr		(0 << DEBUG_LL_UART_RSHFT)
+#define lsr		(5 << DEBUG_LL_UART_RSHFT)
+#define LSR_THRE	0x20	/* Xmit holding register empty */
+
+static inline void PUTC_LL(char ch)
+{
+	while (!(__raw_readb(DEBUG_LL_UART_ADDR + lsr) & LSR_THRE))
+		;
+
+	__raw_writeb(ch, DEBUG_LL_UART_ADDR + rbr);
+}
+
+#endif /* __INCLUDE_ARCH_DEBUG_LL_H__ */
-- 
1.9.2


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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 3/7] clocksource: add uemd clocksource
  2014-05-22 19:48 [PATCH v2 0/7] ARM: initial support for RC Module UEMD SoCs and MB 77.07 board Antony Pavlov
  2014-05-22 19:48 ` [PATCH v2 1/7] ARM: initial support for RC Module UEMD SoCs Antony Pavlov
  2014-05-22 19:48 ` [PATCH v2 2/7] ARM: uemd: add DEBUG_LL support Antony Pavlov
@ 2014-05-22 19:48 ` Antony Pavlov
  2014-05-22 19:48 ` [PATCH v2 4/7] ARM: dts: add minimal К1879ХБ1Я devicetree file Antony Pavlov
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Antony Pavlov @ 2014-05-22 19:48 UTC (permalink / raw)
  To: barebox

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 drivers/clocksource/Kconfig  |   4 ++
 drivers/clocksource/Makefile |   1 +
 drivers/clocksource/uemd.c   | 130 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 135 insertions(+)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 43974f0..c1480ce 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -48,3 +48,7 @@ config CLOCKSOURCE_NOMADIK
 config CLOCKSOURCE_ORION
 	bool
 	depends on ARCH_MVEBU
+
+config CLOCKSOURCE_UEMD
+	bool
+	depends on ARCH_UEMD
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
index 834a15d..97c0288 100644
--- a/drivers/clocksource/Makefile
+++ b/drivers/clocksource/Makefile
@@ -6,3 +6,4 @@ obj-$(CONFIG_CLOCKSOURCE_DUMMY)   += dummy.o
 obj-$(CONFIG_CLOCKSOURCE_MVEBU)   += mvebu.o
 obj-$(CONFIG_CLOCKSOURCE_NOMADIK) += nomadik.o
 obj-$(CONFIG_CLOCKSOURCE_ORION)   += orion.o
+obj-$(CONFIG_CLOCKSOURCE_UEMD)    += uemd.o
diff --git a/drivers/clocksource/uemd.c b/drivers/clocksource/uemd.c
new file mode 100644
index 0000000..2ea455e
--- /dev/null
+++ b/drivers/clocksource/uemd.c
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2014 Antony Pavlov <antonynpavlov@gmail.com>
+ *
+ * Based on
+ * https://github.com/RC-MODULE/linux-3.10.x/tree/k1879-3.10.28/arch/arm/mach-uemd/clocksource.c
+ * (C) 2011 RC Module, Sergey Mironov <ierton@gmail.com>
+ *
+ * This file is part of barebox.
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <common.h>
+#include <io.h>
+#include <init.h>
+#include <linux/bitops.h>
+#include <linux/clk.h>
+#include <clock.h>
+
+#define TIMER_LOAD		0x00
+#define TIMER_VALUE		0x04
+#define TIMER_CONTROL		0x08
+
+#define TIMER_CTRL_ENABLE	BIT(7)
+
+/*
+ * TIMER_CONTROL_PERIODIC:
+ * The counter generates an interrupt at a constant interval,
+ * reloading the original value after wrapping past zero.
+ */
+#define TIMER_CTRL_PERIODIC	BIT(6)
+
+/* interrupt enable */
+#define TIMER_CTRL_IE		BIT(5)
+
+/* Prescalers */
+#define TIMER_CTRL_P1		(0 << 2)
+#define TIMER_CTRL_P16		(1 << 2)
+#define TIMER_CTRL_P256		(2 << 2)
+
+/* Counter register size is 32 Bit long */
+#define TIMER_CTRL_32BIT	BIT(1)
+
+static void __iomem *timer_base;
+
+static uint64_t uemd_timer_cs_read(void)
+{
+	/* Down counter! */
+	return ~__raw_readl(timer_base + TIMER_VALUE);
+}
+
+static struct clocksource uemd_cs = {
+	.read = uemd_timer_cs_read,
+	.mask = CLOCKSOURCE_MASK(32),
+};
+
+static int uemd_timer_probe(struct device_d *dev)
+{
+	int mode;
+	struct clk *timer_clk;
+
+	/* use only one timer */
+	if (timer_base)
+		return -EBUSY;
+
+	timer_base = dev_request_mem_region(dev, 0);
+	if (!timer_base) {
+		dev_err(dev, "could not get memory region\n");
+		return -ENODEV;
+	}
+
+	timer_clk = clk_get(dev, NULL);
+	if (IS_ERR(timer_clk)) {
+		int ret = PTR_ERR(timer_clk);
+		dev_err(dev, "clock not found: %d\n", ret);
+		return ret;
+	}
+
+	/* Stop timer */
+	__raw_writel(0, timer_base + TIMER_CONTROL);
+
+	/* Setup */
+	__raw_writel(0xffffffff, timer_base + TIMER_LOAD);
+	__raw_writel(0xffffffff, timer_base + TIMER_VALUE);
+
+	mode =	TIMER_CTRL_32BIT	|
+		TIMER_CTRL_PERIODIC	|
+		TIMER_CTRL_P1;
+	__raw_writel(mode, timer_base + TIMER_CONTROL);
+
+	/* Fire it up! */
+	mode |= TIMER_CTRL_ENABLE;
+	__raw_writel(mode, timer_base + TIMER_CONTROL);
+
+	clocks_calc_mult_shift(&uemd_cs.mult, &uemd_cs.shift,
+		clk_get_rate(timer_clk), NSEC_PER_SEC, 10);
+
+	init_clock(&uemd_cs);
+
+	return 0;
+}
+
+static __maybe_unused struct of_device_id uemd_timer_dt_ids[] = {
+	{
+		.compatible = "module,uemd-timer",
+	}, {
+		/* sentinel */
+	}
+};
+
+static struct driver_d uemd_timer_driver = {
+	.probe	= uemd_timer_probe,
+	.name	= "uemd-timer",
+	.of_compatible = DRV_OF_COMPAT(uemd_timer_dt_ids),
+};
+
+static int uemd_timer_init(void)
+{
+	return platform_driver_register(&uemd_timer_driver);
+}
+coredevice_initcall(uemd_timer_init);
-- 
1.9.2


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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 4/7] ARM: dts: add minimal К1879ХБ1Я devicetree file
  2014-05-22 19:48 [PATCH v2 0/7] ARM: initial support for RC Module UEMD SoCs and MB 77.07 board Antony Pavlov
                   ` (2 preceding siblings ...)
  2014-05-22 19:48 ` [PATCH v2 3/7] clocksource: add uemd clocksource Antony Pavlov
@ 2014-05-22 19:48 ` Antony Pavlov
  2014-05-22 19:48 ` [PATCH v2 5/7] ARM: uemd: add mb7707 board support Antony Pavlov
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Antony Pavlov @ 2014-05-22 19:48 UTC (permalink / raw)
  To: barebox

К1879ХБ1Я (AKA K1879HB1YA) is a SoC that combines
a NeuroMatrix(r) family DSP core
with an ARM architecture CPU ARM1176JZF-S core.

See http://www.module.ru/en/catalog/micro/mikroshema_dekodera_cifrovogo_televizionnogo_signala_sbis_k1879hb1ya/ for details.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/arm/dts/k1879hb1ya.dtsi | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/arch/arm/dts/k1879hb1ya.dtsi b/arch/arm/dts/k1879hb1ya.dtsi
new file mode 100644
index 0000000..83ba7fb
--- /dev/null
+++ b/arch/arm/dts/k1879hb1ya.dtsi
@@ -0,0 +1,37 @@
+#include "skeleton.dtsi"
+
+/ {
+	soc {
+		compatible = "simple-bus";
+		model = "RC Module K1879HB1YA";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		/*
+		 * Actually clk_apb is not a fixed-clock at all.
+		 * clk_apb is a derivated clock, but for the moment
+		 * there is no public documentation on k1879hb1ya
+		 * so we can't describe it correctly.
+		 */
+		clk_apb: clock@0 {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+		};
+
+		serial0: serial@2002b000 {
+			compatible = "ns16550a";
+			reg = <0x2002b000 0x1000>;
+			reg-shift = <2>;
+			clocks = <&clk_apb 0>;
+			status = "disabled";
+		};
+
+		timer0: timer@20024000 {
+			compatible = "module,uemd-timer";
+			reg = <0x20024000 0x20>;
+			clocks = <&clk_apb 0>;
+			status = "disabled";
+		};
+	};
+};
-- 
1.9.2


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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 5/7] ARM: uemd: add mb7707 board support
  2014-05-22 19:48 [PATCH v2 0/7] ARM: initial support for RC Module UEMD SoCs and MB 77.07 board Antony Pavlov
                   ` (3 preceding siblings ...)
  2014-05-22 19:48 ` [PATCH v2 4/7] ARM: dts: add minimal К1879ХБ1Я devicetree file Antony Pavlov
@ 2014-05-22 19:48 ` Antony Pavlov
  2014-05-22 19:48 ` [PATCH v2 6/7] ARM: uemd: add module-mb7707_defconfig Antony Pavlov
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Antony Pavlov @ 2014-05-22 19:48 UTC (permalink / raw)
  To: barebox

The MB 77.07 is a small (80x80 mm) single-board computer
developed in Russia by the RC Module.
It was developed as an educational board for К1879ХБ1Я SoC
capabilities demonstration.

See http://www.module.ru/en/catalog/micro/micro_pc/ for details.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/arm/boards/Makefile                 |  1 +
 arch/arm/boards/module-mb7707/Makefile   |  2 ++
 arch/arm/boards/module-mb7707/board.c    | 43 ++++++++++++++++++++++++++++++++
 arch/arm/boards/module-mb7707/lowlevel.c | 34 +++++++++++++++++++++++++
 arch/arm/dts/module-mb7707.dts           | 24 ++++++++++++++++++
 arch/arm/mach-uemd/Kconfig               |  9 +++++++
 6 files changed, 113 insertions(+)

diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index ae01b29..91e0f30 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -48,6 +48,7 @@ obj-$(CONFIG_MACH_HIGHBANK)			+= highbank/
 obj-$(CONFIG_MACH_IMX21ADS)			+= freescale-mx21-ads/
 obj-$(CONFIG_MACH_IMX233_OLINUXINO)		+= imx233-olinuxino/
 obj-$(CONFIG_MACH_IMX27ADS)			+= freescale-mx27-ads/
+obj-$(CONFIG_MACH_MB7707)			+= module-mb7707/
 obj-$(CONFIG_MACH_MIOA701)			+= mioa701/
 obj-$(CONFIG_MACH_MMCCPU)			+= mmccpu/
 obj-$(CONFIG_MACH_MX23EVK)			+= freescale-mx23-evk/
diff --git a/arch/arm/boards/module-mb7707/Makefile b/arch/arm/boards/module-mb7707/Makefile
new file mode 100644
index 0000000..01c7a25
--- /dev/null
+++ b/arch/arm/boards/module-mb7707/Makefile
@@ -0,0 +1,2 @@
+obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/module-mb7707/board.c b/arch/arm/boards/module-mb7707/board.c
new file mode 100644
index 0000000..7ffad6e
--- /dev/null
+++ b/arch/arm/boards/module-mb7707/board.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2014 Antony Pavlov <antonynpavlov@gmail.com>
+ *
+ * This file is part of barebox.
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <common.h>
+#include <init.h>
+#include <driver.h>
+#include <usb/ehci.h>
+#include <mach/hardware.h>
+
+static int hostname_init(void)
+{
+	barebox_set_hostname("mb7707");
+
+	return 0;
+}
+core_initcall(hostname_init);
+
+static struct ehci_platform_data ehci_pdata = {
+	.flags = 0,
+};
+
+static int mb7707_devices_init(void)
+{
+	add_usb_ehci_device(DEVICE_ID_DYNAMIC, UEMD_EHCI_BASE,
+		UEMD_EHCI_BASE + 0x10, &ehci_pdata);
+
+	return 0;
+}
+device_initcall(mb7707_devices_init);
diff --git a/arch/arm/boards/module-mb7707/lowlevel.c b/arch/arm/boards/module-mb7707/lowlevel.c
new file mode 100644
index 0000000..5f5e1d7
--- /dev/null
+++ b/arch/arm/boards/module-mb7707/lowlevel.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2014 Antony Pavlov <antonynpavlov@gmail.com>
+ *
+ * This file is part of barebox.
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#define __LOWLEVEL_INIT__
+
+#include <common.h>
+#include <asm/barebox-arm.h>
+#include <asm/barebox-arm-head.h>
+#include <init.h>
+#include <sizes.h>
+
+#define MB7707_SRAM_BASE 0x40000000
+#define MB7707_SRAM_SIZE SZ_128M
+
+void __naked __bare_init barebox_arm_reset_vector(void)
+{
+	arm_cpu_lowlevel_init();
+
+	barebox_arm_entry(MB7707_SRAM_BASE, MB7707_SRAM_SIZE, 0);
+}
diff --git a/arch/arm/dts/module-mb7707.dts b/arch/arm/dts/module-mb7707.dts
new file mode 100644
index 0000000..94a3373
--- /dev/null
+++ b/arch/arm/dts/module-mb7707.dts
@@ -0,0 +1,24 @@
+/dts-v1/;
+
+#include "k1879hb1ya.dtsi"
+
+/ {
+	model = "Module MB 77.07";
+	compatible = "module,mb7707";
+
+	memory {
+		reg = <0x40000000 0x8000000>;
+	};
+};
+
+&clk_apb {
+	clock-frequency = <54000000>;
+};
+
+&serial0 {
+	status = "okay";
+};
+
+&timer0 {
+	status = "okay";
+};
diff --git a/arch/arm/mach-uemd/Kconfig b/arch/arm/mach-uemd/Kconfig
index f9cf859..aedd757 100644
--- a/arch/arm/mach-uemd/Kconfig
+++ b/arch/arm/mach-uemd/Kconfig
@@ -4,4 +4,13 @@ config ARCH_TEXT_BASE
 	hex
 	default 0x40800000
 
+choice
+	prompt "UEMD Board type"
+
+config MACH_MB7707
+	bool "MB7707"
+	select HAVE_DEFAULT_ENVIRONMENT_NEW
+
+endchoice
+
 endif
-- 
1.9.2


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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 6/7] ARM: uemd: add module-mb7707_defconfig
  2014-05-22 19:48 [PATCH v2 0/7] ARM: initial support for RC Module UEMD SoCs and MB 77.07 board Antony Pavlov
                   ` (4 preceding siblings ...)
  2014-05-22 19:48 ` [PATCH v2 5/7] ARM: uemd: add mb7707 board support Antony Pavlov
@ 2014-05-22 19:48 ` Antony Pavlov
  2014-05-22 19:48 ` [PATCH v2 7/7] ARM: mb7707: add barebox mini-howto Antony Pavlov
  2014-05-27  5:14 ` [PATCH v2 0/7] ARM: initial support for RC Module UEMD SoCs and MB 77.07 board Sascha Hauer
  7 siblings, 0 replies; 12+ messages in thread
From: Antony Pavlov @ 2014-05-22 19:48 UTC (permalink / raw)
  To: barebox

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/arm/configs/module-mb7707_defconfig | 49 ++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/arch/arm/configs/module-mb7707_defconfig b/arch/arm/configs/module-mb7707_defconfig
new file mode 100644
index 0000000..9a4f1d1
--- /dev/null
+++ b/arch/arm/configs/module-mb7707_defconfig
@@ -0,0 +1,49 @@
+CONFIG_BUILTIN_DTB=y
+CONFIG_BUILTIN_DTB_NAME="module-mb7707"
+CONFIG_ARCH_UEMD=y
+CONFIG_AEABI=y
+CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
+CONFIG_PBL_IMAGE=y
+CONFIG_PBL_RELOCATABLE=y
+CONFIG_MALLOC_TLSF=y
+CONFIG_PROMPT="MB 77.07: "
+CONFIG_BAUDRATE=38400
+CONFIG_GLOB=y
+CONFIG_HUSH_FANCY_PROMPT=y
+CONFIG_CMDLINE_EDITING=y
+CONFIG_AUTO_COMPLETE=y
+CONFIG_MENU=y
+CONFIG_PASSWORD=y
+CONFIG_LONGHELP=y
+CONFIG_CMD_IOMEM=y
+CONFIG_CMD_MEMINFO=y
+# CONFIG_CMD_BOOTM is not set
+# CONFIG_CMD_BOOTU is not set
+CONFIG_CMD_GO=y
+CONFIG_CMD_LOADB=y
+CONFIG_CMD_LOADY=y
+CONFIG_CMD_RESET=y
+# CONFIG_CMD_MOUNT is not set
+# CONFIG_CMD_UMOUNT is not set
+CONFIG_CMD_EXPORT=y
+CONFIG_CMD_PRINTENV=y
+CONFIG_CMD_UNCOMPRESS=y
+CONFIG_CMD_SLEEP=y
+CONFIG_CMD_ECHO_E=y
+CONFIG_CMD_EDIT=y
+CONFIG_CMD_READLINE=y
+CONFIG_CMD_MM=y
+CONFIG_CMD_CLK=y
+CONFIG_CMD_OF_NODE=y
+CONFIG_CMD_OF_PROPERTY=y
+CONFIG_CMD_OFTREE=y
+CONFIG_CMD_TIME=y
+CONFIG_OF_BAREBOX_DRIVERS=y
+CONFIG_DRIVER_SERIAL_NS16550=y
+# CONFIG_SPI is not set
+CONFIG_USB=y
+CONFIG_USB_EHCI=y
+CONFIG_USB_STORAGE=y
+CONFIG_CLOCKSOURCE_DUMMY=y
+CONFIG_SHA1=y
+CONFIG_SHA256=y
-- 
1.9.2


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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 7/7] ARM: mb7707: add barebox mini-howto
  2014-05-22 19:48 [PATCH v2 0/7] ARM: initial support for RC Module UEMD SoCs and MB 77.07 board Antony Pavlov
                   ` (5 preceding siblings ...)
  2014-05-22 19:48 ` [PATCH v2 6/7] ARM: uemd: add module-mb7707_defconfig Antony Pavlov
@ 2014-05-22 19:48 ` Antony Pavlov
  2014-05-27  5:14 ` [PATCH v2 0/7] ARM: initial support for RC Module UEMD SoCs and MB 77.07 board Sascha Hauer
  7 siblings, 0 replies; 12+ messages in thread
From: Antony Pavlov @ 2014-05-22 19:48 UTC (permalink / raw)
  To: barebox

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/arm/boards/module-mb7707/module-mb7707.dox | 29 +++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/arch/arm/boards/module-mb7707/module-mb7707.dox b/arch/arm/boards/module-mb7707/module-mb7707.dox
new file mode 100644
index 0000000..c0dbc8a
--- /dev/null
+++ b/arch/arm/boards/module-mb7707/module-mb7707.dox
@@ -0,0 +1,29 @@
+/** @page module-mb7707 MB 77.07 board
+
+The board uses MBOOT as bootloader.
+
+Barebox mini-howto:
+
+1. Connect to the boards's UART (38400 8N1);
+
+2. Turn board's power on;
+
+3. Wait 'Hit any key (in 2 sec) to skip autoload...' prompt and press the space key;
+
+4. Compile zbarebox.bin image and upload it to the board via tftp
+@verbatim
+    MBOOT # tftpboot zbarebox.bin
+    greth: greth_halt
+    TFTP Using GRETH_10/100 device
+    TFTP params: server 192.168.0.1 our_ip 192.168.0.7
+    TFTP params: filename 'zbarebox.bin' load_address 0x40100000
+    TFTP Loading: ################
+    TFTP done
+@endverbatim
+
+5. Run barebox
+@verbatim
+    MBOOT # go 0x40100000
+@endverbatim
+
+*/
-- 
1.9.2


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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 0/7] ARM: initial support for RC Module UEMD SoCs and MB 77.07 board
  2014-05-22 19:48 [PATCH v2 0/7] ARM: initial support for RC Module UEMD SoCs and MB 77.07 board Antony Pavlov
                   ` (6 preceding siblings ...)
  2014-05-22 19:48 ` [PATCH v2 7/7] ARM: mb7707: add barebox mini-howto Antony Pavlov
@ 2014-05-27  5:14 ` Sascha Hauer
  7 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2014-05-27  5:14 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Thu, May 22, 2014 at 11:48:43PM +0400, Antony Pavlov wrote:
> Research Centre "Module" (RC Module) is
> a Russian development company designing
> mixed-signal ASICs and real-time video-image
> processing systems.
> 
> К1879ХБ1Я (AKA K1879HB1YA) is a UEMD family SoC that combines
> a DSP core based on the NeuroMatrix(r) family
> with an ARM architecture CPU ARM1176JZF-S core.
> 
> The MB 77.07 is a small (80x80 mm) single-board computer
> developed in Russia by the RC Module.
> It was developed as an educational board for К1879ХБ1Я SoC
> capabilities demonstration.
> 
> See http://www.module.ru/en/catalog/micro/micro_pc/ for details.
> 

Applied, thanks

Sascha

> Changes since v1:
> 
>   1. fix reset_cpu()
>   2. fix pbl image build
>   3. add usb support
>   4. add uemd clocksource
>   5. add mb7707 barebox mini-howto
> 
> Antony Pavlov (7):
>   ARM: initial support for RC Module UEMD SoCs
>   ARM: uemd: add DEBUG_LL support
>   clocksource: add uemd clocksource
>   ARM: dts: add minimal К1879ХБ1Я devicetree file
>   ARM: uemd: add mb7707 board support
>   ARM: uemd: add module-mb7707_defconfig
>   ARM: mb7707: add barebox mini-howto
> 
>  arch/arm/Kconfig                                |  12 +++
>  arch/arm/Makefile                               |   1 +
>  arch/arm/boards/Makefile                        |   1 +
>  arch/arm/boards/module-mb7707/Makefile          |   2 +
>  arch/arm/boards/module-mb7707/board.c           |  43 ++++++++
>  arch/arm/boards/module-mb7707/lowlevel.c        |  34 +++++++
>  arch/arm/boards/module-mb7707/module-mb7707.dox |  29 ++++++
>  arch/arm/configs/module-mb7707_defconfig        |  49 +++++++++
>  arch/arm/dts/k1879hb1ya.dtsi                    |  37 +++++++
>  arch/arm/dts/module-mb7707.dts                  |  24 +++++
>  arch/arm/mach-uemd/Kconfig                      |  16 +++
>  arch/arm/mach-uemd/Makefile                     |   1 +
>  arch/arm/mach-uemd/include/mach/debug_ll.h      |  42 ++++++++
>  arch/arm/mach-uemd/include/mach/hardware.h      |   7 ++
>  arch/arm/mach-uemd/reset.c                      |  24 +++++
>  drivers/clocksource/Kconfig                     |   4 +
>  drivers/clocksource/Makefile                    |   1 +
>  drivers/clocksource/uemd.c                      | 130 ++++++++++++++++++++++++
>  18 files changed, 457 insertions(+)
>  create mode 100644 arch/arm/boards/module-mb7707/Makefile
>  create mode 100644 arch/arm/boards/module-mb7707/board.c
>  create mode 100644 arch/arm/boards/module-mb7707/lowlevel.c
>  create mode 100644 arch/arm/boards/module-mb7707/module-mb7707.dox
>  create mode 100644 arch/arm/configs/module-mb7707_defconfig
>  create mode 100644 arch/arm/dts/k1879hb1ya.dtsi
>  create mode 100644 arch/arm/dts/module-mb7707.dts
>  create mode 100644 arch/arm/mach-uemd/Kconfig
>  create mode 100644 arch/arm/mach-uemd/Makefile
>  create mode 100644 arch/arm/mach-uemd/include/mach/debug_ll.h
>  create mode 100644 arch/arm/mach-uemd/include/mach/hardware.h
>  create mode 100644 arch/arm/mach-uemd/reset.c
>  create mode 100644 drivers/clocksource/uemd.c
> 
> -- 
> 1.9.2
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/7] ARM: uemd: add DEBUG_LL support
  2014-05-22 19:48 ` [PATCH v2 2/7] ARM: uemd: add DEBUG_LL support Antony Pavlov
@ 2014-05-30  6:09   ` Holger Schurig
  2014-05-30  9:05     ` Antony Pavlov
  0 siblings, 1 reply; 12+ messages in thread
From: Holger Schurig @ 2014-05-30  6:09 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

2014-05-22 21:48 GMT+02:00 Antony Pavlov <antonynpavlov@gmail.com>:
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -203,6 +203,7 @@ config ARCH_UEMD
>         select OFDEVICE
>         select OFTREE
>         select CLOCKSOURCE_UEMD
> +       select HAS_DEBUG_LL

Why not putting this into the _defconfig?

(On my device, it's neither in defconfig nor in Kconfig, I only had it
on in the initial "bring it to live" period. Afterwards I turned it
off)

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/7] ARM: uemd: add DEBUG_LL support
  2014-05-30  9:05     ` Antony Pavlov
@ 2014-05-30  9:03       ` Holger Schurig
  0 siblings, 0 replies; 12+ messages in thread
From: Holger Schurig @ 2014-05-30  9:03 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

Oops, you're of course right!

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/7] ARM: uemd: add DEBUG_LL support
  2014-05-30  6:09   ` Holger Schurig
@ 2014-05-30  9:05     ` Antony Pavlov
  2014-05-30  9:03       ` Holger Schurig
  0 siblings, 1 reply; 12+ messages in thread
From: Antony Pavlov @ 2014-05-30  9:05 UTC (permalink / raw)
  To: Holger Schurig; +Cc: barebox

On Fri, 30 May 2014 08:09:21 +0200
Holger Schurig <holgerschurig@gmail.com> wrote:

> 2014-05-22 21:48 GMT+02:00 Antony Pavlov <antonynpavlov@gmail.com>:
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> > @@ -203,6 +203,7 @@ config ARCH_UEMD
> >         select OFDEVICE
> >         select OFTREE
> >         select CLOCKSOURCE_UEMD
> > +       select HAS_DEBUG_LL
> 
> Why not putting this into the _defconfig?

I suppose you are mixing up HAS_DEBUG_LL with DEBUG_LL.

DEBUG_LL depends on HAS_DEBUG_LL. If HAS_DEBUG_LL=y then DEBUG_LL can be enabled or DEBUG_LL can be disabled.
So you have no chance to use DEBUG_LL without HAS_DEBUG_LL=y!

If you want to enable HAS_DEBUG_LL you have to explicitly select it in a Kconfig file.
You can't use just _defconfig for HAS_DEBUG_LL enabling.

> (On my device, it's neither in defconfig nor in Kconfig, I only had it
> on in the initial "bring it to live" period. Afterwards I turned it
> off)


-- 
-- 
Best regards,
  Antony Pavlov

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-05-30  9:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-22 19:48 [PATCH v2 0/7] ARM: initial support for RC Module UEMD SoCs and MB 77.07 board Antony Pavlov
2014-05-22 19:48 ` [PATCH v2 1/7] ARM: initial support for RC Module UEMD SoCs Antony Pavlov
2014-05-22 19:48 ` [PATCH v2 2/7] ARM: uemd: add DEBUG_LL support Antony Pavlov
2014-05-30  6:09   ` Holger Schurig
2014-05-30  9:05     ` Antony Pavlov
2014-05-30  9:03       ` Holger Schurig
2014-05-22 19:48 ` [PATCH v2 3/7] clocksource: add uemd clocksource Antony Pavlov
2014-05-22 19:48 ` [PATCH v2 4/7] ARM: dts: add minimal К1879ХБ1Я devicetree file Antony Pavlov
2014-05-22 19:48 ` [PATCH v2 5/7] ARM: uemd: add mb7707 board support Antony Pavlov
2014-05-22 19:48 ` [PATCH v2 6/7] ARM: uemd: add module-mb7707_defconfig Antony Pavlov
2014-05-22 19:48 ` [PATCH v2 7/7] ARM: mb7707: add barebox mini-howto Antony Pavlov
2014-05-27  5:14 ` [PATCH v2 0/7] ARM: initial support for RC Module UEMD SoCs and MB 77.07 board Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox