summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/Kconfig12
-rw-r--r--arch/arm/Makefile1
-rw-r--r--arch/arm/boards/Makefile1
-rw-r--r--arch/arm/boards/module-mb7707/Makefile2
-rw-r--r--arch/arm/boards/module-mb7707/board.c43
-rw-r--r--arch/arm/boards/module-mb7707/lowlevel.c34
-rw-r--r--arch/arm/boards/module-mb7707/module-mb7707.dox29
-rw-r--r--arch/arm/configs/module-mb7707_defconfig49
-rw-r--r--arch/arm/dts/k1879hb1ya.dtsi37
-rw-r--r--arch/arm/dts/module-mb7707.dts24
-rw-r--r--arch/arm/mach-uemd/Kconfig16
-rw-r--r--arch/arm/mach-uemd/Makefile1
-rw-r--r--arch/arm/mach-uemd/include/mach/debug_ll.h42
-rw-r--r--arch/arm/mach-uemd/include/mach/hardware.h7
-rw-r--r--arch/arm/mach-uemd/reset.c24
15 files changed, 322 insertions, 0 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 6e54c8f55a..8674a2d17c 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -194,6 +194,17 @@ 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
+ select HAS_DEBUG_LL
+
config ARCH_ZYNQ
bool "Xilinx Zynq-based boards"
select HAS_DEBUG_LL
@@ -220,6 +231,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 c5769991fd..64db73c62e 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/boards/Makefile b/arch/arm/boards/Makefile
index 15d20bee3d..be03e9b32e 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 0000000000..01c7a259e9
--- /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 0000000000..7ffad6e62a
--- /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 0000000000..5f5e1d7af1
--- /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/boards/module-mb7707/module-mb7707.dox b/arch/arm/boards/module-mb7707/module-mb7707.dox
new file mode 100644
index 0000000000..c0dbc8a602
--- /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
+
+*/
diff --git a/arch/arm/configs/module-mb7707_defconfig b/arch/arm/configs/module-mb7707_defconfig
new file mode 100644
index 0000000000..9a4f1d1cb6
--- /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
diff --git a/arch/arm/dts/k1879hb1ya.dtsi b/arch/arm/dts/k1879hb1ya.dtsi
new file mode 100644
index 0000000000..83ba7fb399
--- /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";
+ };
+ };
+};
diff --git a/arch/arm/dts/module-mb7707.dts b/arch/arm/dts/module-mb7707.dts
new file mode 100644
index 0000000000..94a3373fc1
--- /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
new file mode 100644
index 0000000000..aedd7574ac
--- /dev/null
+++ b/arch/arm/mach-uemd/Kconfig
@@ -0,0 +1,16 @@
+if ARCH_UEMD
+
+config ARCH_TEXT_BASE
+ hex
+ default 0x40800000
+
+choice
+ prompt "UEMD Board type"
+
+config MACH_MB7707
+ bool "MB7707"
+ select HAVE_DEFAULT_ENVIRONMENT_NEW
+
+endchoice
+
+endif
diff --git a/arch/arm/mach-uemd/Makefile b/arch/arm/mach-uemd/Makefile
new file mode 100644
index 0000000000..f3cc6684b8
--- /dev/null
+++ b/arch/arm/mach-uemd/Makefile
@@ -0,0 +1 @@
+obj-y += reset.o
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 0000000000..ce182446b0
--- /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__ */
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 0000000000..2311ebf1cd
--- /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 0000000000..00ae0be0b3
--- /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);