mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [RFC 1/5] ARM: add very initial support for Canon DIGIC chips
Date: Mon,  5 Aug 2013 00:25:23 +0400	[thread overview]
Message-ID: <1375647927-30627-2-git-send-email-antonynpavlov@gmail.com> (raw)
In-Reply-To: <1375647927-30627-1-git-send-email-antonynpavlov@gmail.com>

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/arm/Kconfig                            |  8 +++++
 arch/arm/Makefile                           |  1 +
 arch/arm/mach-digic/Kconfig                 |  8 +++++
 arch/arm/mach-digic/Makefile                |  1 +
 arch/arm/mach-digic/core.c                  | 25 +++++++++++++++
 arch/arm/mach-digic/include/mach/debug_ll.h | 48 +++++++++++++++++++++++++++++
 6 files changed, 91 insertions(+)
 create mode 100644 arch/arm/mach-digic/Kconfig
 create mode 100644 arch/arm/mach-digic/Makefile
 create mode 100644 arch/arm/mach-digic/core.c
 create mode 100644 arch/arm/mach-digic/include/mach/debug_ll.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e4db8da..377f667 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -54,6 +54,13 @@ config ARCH_CLPS711X
 	select GPIOLIB
 	select MFD_SYSCON
 
+config ARCH_DIGIC
+	bool "Canon DIGIC-based cameras"
+	select CPU_32v5
+	select HAS_DEBUG_LL
+	help
+	  Support for Canon's digital cameras that use the DIGIC4 ASIC.
+
 config ARCH_EP93XX
 	bool "Cirrus Logic EP93xx"
 	select CPU_ARM920T
@@ -171,6 +178,7 @@ source arch/arm/cpu/Kconfig
 source arch/arm/mach-at91/Kconfig
 source arch/arm/mach-bcm2835/Kconfig
 source arch/arm/mach-clps711x/Kconfig
+source arch/arm/mach-digic/Kconfig
 source arch/arm/mach-ep93xx/Kconfig
 source arch/arm/mach-highbank/Kconfig
 source arch/arm/mach-imx/Kconfig
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index d80c12c..1b3040e 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -54,6 +54,7 @@ AFLAGS   += -include asm/unified.h -msoft-float $(AFLAGS_THUMB2)
 machine-$(CONFIG_ARCH_AT91)		:= at91
 machine-$(CONFIG_ARCH_BCM2835)		:= bcm2835
 machine-$(CONFIG_ARCH_CLPS711X)		:= clps711x
+machine-$(CONFIG_ARCH_DIGIC)		:= digic
 machine-$(CONFIG_ARCH_EP93XX)		:= ep93xx
 machine-$(CONFIG_ARCH_HIGHBANK)		:= highbank
 machine-$(CONFIG_ARCH_IMX)		:= imx
diff --git a/arch/arm/mach-digic/Kconfig b/arch/arm/mach-digic/Kconfig
new file mode 100644
index 0000000..49ce44a
--- /dev/null
+++ b/arch/arm/mach-digic/Kconfig
@@ -0,0 +1,8 @@
+if ARCH_DIGIC
+
+choice
+	prompt "camera type"
+
+endchoice
+
+endif
diff --git a/arch/arm/mach-digic/Makefile b/arch/arm/mach-digic/Makefile
new file mode 100644
index 0000000..820eb10
--- /dev/null
+++ b/arch/arm/mach-digic/Makefile
@@ -0,0 +1 @@
+obj-y += core.o
diff --git a/arch/arm/mach-digic/core.c b/arch/arm/mach-digic/core.c
new file mode 100644
index 0000000..f222c5b
--- /dev/null
+++ b/arch/arm/mach-digic/core.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2013 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(unsigned long ignored)
+{
+	while (1)
+		;
+}
+EXPORT_SYMBOL(reset_cpu);
diff --git a/arch/arm/mach-digic/include/mach/debug_ll.h b/arch/arm/mach-digic/include/mach/debug_ll.h
new file mode 100644
index 0000000..23e5966
--- /dev/null
+++ b/arch/arm/mach-digic/include/mach/debug_ll.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2013 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.
+ *
+ */
+
+#ifndef __MACH_DEBUG_LL_H__
+#define __MACH_DEBUG_LL_H__
+
+#include <io.h>
+
+/* _sleep(0x400000); -> 3 seconds on Canon EOS 600D */
+static inline void _sleep(int delay)
+{
+	int i;
+
+	for (i = 0; i < delay; i++) {
+		asm ("nop\n");
+		asm ("nop\n");
+	}
+}
+
+/* Serial interface registers */
+#define UART_BASE       0xC0800000
+#define UART_TX         (UART_BASE + 0x0)
+#define UART_RX         (UART_BASE + 0x4)
+#define UART_ST         (UART_BASE + 0x14)
+
+static inline void PUTC_LL(char ch)
+{
+	/* FIXME! need check UART status first */
+
+	writeb(ch, UART_TX);
+	_sleep(0x1000);
+}
+
+#endif
-- 
1.8.3.1


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

  reply	other threads:[~2013-08-04 20:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-04 20:25 [RFC 0/5] JUST-FOR-FUN: run barebox on Canon digital camera Antony Pavlov
2013-08-04 20:25 ` Antony Pavlov [this message]
2013-08-04 20:25 ` [RFC 2/5] ARM: DIGIC: add Canon EOS 600D support Antony Pavlov
2013-08-04 20:25 ` [RFC 3/5] ARM: DIGIC: add Canon PowerShot A1100 IS support Antony Pavlov
2013-08-04 20:25 ` [RFC 4/5] ARM: DIGIC: add canon-600d_defconfig Antony Pavlov
2013-08-04 20:25 ` [RFC 5/5] ARM: DIGIC: add canon-a1100_defconfig Antony Pavlov
2013-08-06  7:13 ` [RFC 0/5] JUST-FOR-FUN: run barebox on Canon digital camera Sascha Hauer
2013-08-06  9:42   ` 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=1375647927-30627-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