mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH 2/4] MIPS: add Malta machine support to barebox
Date: Wed, 29 Jun 2011 07:24:16 +0400	[thread overview]
Message-ID: <1309317858-11861-2-git-send-email-antonynpavlov@gmail.com> (raw)
In-Reply-To: <1309317858-11861-1-git-send-email-antonynpavlov@gmail.com>

The machines use big-endian mode.
Only supported peripheral is serial port.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/mips/Kconfig                                |   13 ++++++++
 arch/mips/Makefile                               |    2 +
 arch/mips/mach-mti-malta/Kconfig                 |   20 ++++++++++++
 arch/mips/mach-mti-malta/Makefile                |    1 +
 arch/mips/mach-mti-malta/include/mach/hardware.h |   32 +++++++++++++++++++
 arch/mips/mach-mti-malta/reset.c                 |   36 ++++++++++++++++++++++
 6 files changed, 104 insertions(+), 0 deletions(-)
 create mode 100644 arch/mips/mach-mti-malta/Kconfig
 create mode 100644 arch/mips/mach-mti-malta/Makefile
 create mode 100644 arch/mips/mach-mti-malta/include/mach/hardware.h
 create mode 100644 arch/mips/mach-mti-malta/reset.c

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 4681f54..5a8d0f6 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -21,6 +21,17 @@ config GENERIC_LINKER_SCRIPT
 	bool
 	default y
 
+choice
+	prompt "MIPS system type"
+
+config MACH_MIPS_MALTA
+	bool "Malta"
+	select CSRC_R4K_LIB
+	select DRIVER_SERIAL_NS16550
+	select SYS_SUPPORTS_BIG_ENDIAN
+
+endchoice
+
 #
 # Endianess selection.  Sufficiently obscure so many users don't know what to
 # answer,so we try hard to limit the available choices.  Also the use of a
@@ -46,6 +57,8 @@ config CPU_LITTLE_ENDIAN
 
 endchoice
 
+source arch/mips/mach-mti-malta/Kconfig
+
 source common/Kconfig
 source commands/Kconfig
 source net/Kconfig
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index f7d4f32..117c4ae 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -27,6 +27,8 @@ CPPFLAGS += -fdata-sections -ffunction-sections
 LDFLAGS_uboot += -static --gc-sections
 endif
 
+machine-$(CONFIG_MACH_MIPS_MALTA)	:= mti-malta
+
 machdirs := $(patsubst %,arch/mips/mach-%/,$(machine-y))
 
 ifeq ($(KBUILD_SRC),)
diff --git a/arch/mips/mach-mti-malta/Kconfig b/arch/mips/mach-mti-malta/Kconfig
new file mode 100644
index 0000000..c243513
--- /dev/null
+++ b/arch/mips/mach-mti-malta/Kconfig
@@ -0,0 +1,20 @@
+if MACH_MIPS_MALTA
+
+config ARCH_TEXT_BASE
+        hex
+        default 0xa0800000
+
+menu "Mach specific settings        "
+
+config DEBUG_LL
+	bool "DEBUG_LL"
+	default n
+
+endmenu
+
+choice
+	prompt "Select your board"
+
+endchoice
+
+endif
diff --git a/arch/mips/mach-mti-malta/Makefile b/arch/mips/mach-mti-malta/Makefile
new file mode 100644
index 0000000..f3cc668
--- /dev/null
+++ b/arch/mips/mach-mti-malta/Makefile
@@ -0,0 +1 @@
+obj-y += reset.o
diff --git a/arch/mips/mach-mti-malta/include/mach/hardware.h b/arch/mips/mach-mti-malta/include/mach/hardware.h
new file mode 100644
index 0000000..f476355
--- /dev/null
+++ b/arch/mips/mach-mti-malta/include/mach/hardware.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2011 Antony Pavlov <antonynpavlov@gmail.com>
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * This file is part of barebox.
+ *
+ * barebox is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * barebox 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with barebox.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __INCLUDE_ARCH_HARDWARE_H__
+#define   __INCLUDE_ARCH_HARDWARE_H__
+
+#define DEBUG_LL_UART_ADDR	0xb00003f8
+
+/*
+ * Reset register.
+ */
+#define SOFTRES_REG       0xbf000500
+#define GORESET           0x42
+
+#endif  /* __INCLUDE_ARCH_HARDWARE_H__ */
diff --git a/arch/mips/mach-mti-malta/reset.c b/arch/mips/mach-mti-malta/reset.c
new file mode 100644
index 0000000..46c102f
--- /dev/null
+++ b/arch/mips/mach-mti-malta/reset.c
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2011 Antony Pavlov <antonynpavlov@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+/**
+ * @file
+ * @brief Resetting an CPU
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <mach/hardware.h>
+
+void __noreturn mips_machine_restart()
+{
+	__raw_writel(GORESET, (char *)SOFTRES_REG);
+	while (1);
+	/*NOTREACHED*/
+}
+EXPORT_SYMBOL(mips_machine_restart);
-- 
1.7.5.4


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

  reply	other threads:[~2011-06-29  3:24 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-29  3:24 [PATCH 1/4] Add MIPS arch " Antony Pavlov
2011-06-29  3:24 ` Antony Pavlov [this message]
2011-06-30  3:02   ` [PATCH 2/4] MIPS: add Malta machine " Jean-Christophe PLAGNIOL-VILLARD
2011-07-02 14:41   ` Shinya Kuribayashi
2011-07-02 16:45     ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-03 20:44       ` Antony Pavlov
2011-07-04  5:11         ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-04  8:54       ` Antony Pavlov
2011-07-04  8:52         ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-03 20:50     ` Antony Pavlov
2011-06-29  3:24 ` [PATCH 3/4] MIPS: add qemu malta board " Antony Pavlov
2011-06-30  2:58   ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-30  9:12     ` Antony Pavlov
2011-06-30  9:38   ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-30 10:34     ` Antony Pavlov
2011-06-29  3:24 ` [PATCH 4/4] MISP: add documentation template Antony Pavlov
2011-06-29  5:40 ` [PATCH 1/4] Add MIPS arch support to barebox Jean-Christophe PLAGNIOL-VILLARD
2011-06-29  7:53   ` Antony Pavlov
2011-06-30  2:52 ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-30  7:12   ` Franck JULLIEN
2011-06-30  9:18     ` Jean-Christophe PLAGNIOL-VILLARD
2011-06-30  9:13   ` Antony Pavlov
2011-07-02 13:47 ` Shinya Kuribayashi
2011-07-02 16:46   ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-03 20:40   ` Antony Pavlov

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=1309317858-11861-2-git-send-email-antonynpavlov@gmail.com \
    --to=antonynpavlov@gmail.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