mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [RFC 0/5] JUST-FOR-FUN: run barebox on Canon digital camera
@ 2013-08-04 20:25 Antony Pavlov
  2013-08-04 20:25 ` [RFC 1/5] ARM: add very initial support for Canon DIGIC chips Antony Pavlov
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Antony Pavlov @ 2013-08-04 20:25 UTC (permalink / raw)
  To: barebox

Please don't commit the patches!

This patch series introduce minimal support
for Canon DIGIC4-based cameras.

Supported cameras:

 * Canon PowerShot A1100;
 * Canon EOS 600D;
 * Canon EOS Magic Lantern qemu-based emulator.

After booting barebox starts compiled-in script
that use 'mw' command to blink camera's LED.

Just now barebox for Canon cameras is a demo
but after some improvements it can become very
handy tool for CHDK and Magic Lantern development.

Very short Instruction
======================

***************************************************
*                                                 *
* THIS IS DANGEROUS AND MIGHT DAMAGE YOUR CAMERA. *
*  NO WARRANTIES.  NO GUARANTEES.  DO NOT TAUNT.  *
*                                                 *
***************************************************

1. Canon EOS 600D DSLR
----------------------

1.1 Install Magic Lantern firmware on SD-card
 (see http://magiclantern.wikia.com/wiki/Unified/Install#First-time_installation)

1.2 Download and build barebox
    $ git clone -b next.digic https://github.com/frantony/barebox barebox.digic
    $ cd barebox.digic
    $ export ARCH=arm
    $ export CROSS_COMPILE=<your_ARM_toolchain_prefix>
    $ make canon-600d_defconfig
    $ make

You will get the 'arch/arm/pbl/zbarebox.bin' file.

1.3 Overwrite Magic Lantern boot file on your 600D SD-card with the 'zbarebox.bin' file.
E.g., if your SD-card is mounted to the '/mnt/sd' dir, then

    $ sudo cp arch/arm/pbl/zbarebox.bin /mnt/sd/autoexec.bin

1.4 Insert SD-card into your camere.

1.5 Close your camera's SD-card slot.

1.6 Just after SD-card slot closing the barebox will start.
If all going well the SD-card led start blink.

1.7 Uninstall barebox
Remove battery from your camera and erase the 'autoexec.bin'
file from your SD-card.

2. Canon EOS emulator
---------------------

2.1 Download Magic Lantern sources

$ hg clone https://bitbucket.org/hudson/magic-lantern
$ cd magic-lantern

2.2 Setup your build environment

E.g., for Debian Linux:

$ cat > Makefile.user
RST2LATEX=rst2latex
PYTHON=python

GCC_VERSION=
CROSS_COMPILE=<your toolchain path>
<ctrl-d>
$

2.3 Buld Magic Lantern for 600D

$ make 600D

If all going well you can try qemu.

2.4 Bulding qemu

 $ cd contrib/qemu
 $ ./install.sh

 ...

 Use install.sh prompt:
  1) Compile QEMU
  2) Grab a copy of the Canon firmware
  3) Enable CONFIG_QEMU=y in your Makefile.user

2.5 Build barebox image (see paragraph 1.2 Download and build barebox)

Don't forget to edit arch/arm/boards/canon-600d/env/bin/init
__before__ build: comment the 'while true; do' and
the 'done' strings.

2.6 Copy zbarebox.bin to autoexec.bin in your qemu dir.

2.7 Go to your qemu dir and start emulation with ./run_ml_600D.sh

3. Canon PowerShot A1100 IS
---------------------------
Installing to the A1100 camera is a bit tricky as you need
"encrypt" barebox image.

3.1 Install CHDK firmware on SD-card
 (see http://chdk.wikia.com/wiki/CHDK_For_Newbies_-_How_To_Install
 and http://chdk.wikia.com/wiki/A1100).

3.2 Make your SD-card bootable
 (see http://chdk.wikia.com/wiki/Prepare_your_SD_card)

3.3 Download and build barebox
    $ git clone -b next.digic https://github.com/frantony/barebox barebox.digic
    $ cd barebox.digic
    $ export ARCH=arm
    $ export CROSS_COMPILE=<your_ARM_toolchain_prefix>
    $ make canon-a1100_defconfig
    $ make

You will get the 'arch/arm/pbl/zbarebox.bin' file.

3.4 Download CHDK sources

    $ git clone https://github.com/c10ud/CHDK.git
    $ cd CHDK

3.5 Build the 'dancingbits' encoder
    $ cd tools
    $ cc -o dancingbits dancingbits.c

3.6 encode your barebox image

Go to your barebox dir

3.6.1 Make zbarebox.bin > 128K; camera don't like small binaries :)

    $ dd if=/dev/zero bs=1k count=128 >> arch/arm/pbl/zbarebox.bin

3.6.2 encode

    $ <path-to-dancingbits> arch/arm/pbl/zbarebox.bin DISKBOOT.BIN 2

3.7 Overwrite CHDK boot file on your SD-card with the 'DISKBOOT.BIN' file.

3.9 Lock your SD-card (use small switch on the card).

3.10 Insert SD-card into your camera.
Close your camera's SD-card slot.

3.11 Turn your camera on.
If all going well the 'direct print' led start blink.

3.12 Uninstall barebox
Remove battery from your camera and erase the 'DISKBOOT.BIN'
file from your SD-card.

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

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

* [RFC 1/5] ARM: add very initial support for Canon DIGIC chips
  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
  2013-08-04 20:25 ` [RFC 2/5] ARM: DIGIC: add Canon EOS 600D support Antony Pavlov
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Antony Pavlov @ 2013-08-04 20:25 UTC (permalink / raw)
  To: barebox

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

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

* [RFC 2/5] ARM: DIGIC: add Canon EOS 600D support
  2013-08-04 20:25 [RFC 0/5] JUST-FOR-FUN: run barebox on Canon digital camera Antony Pavlov
  2013-08-04 20:25 ` [RFC 1/5] ARM: add very initial support for Canon DIGIC chips Antony Pavlov
@ 2013-08-04 20:25 ` Antony Pavlov
  2013-08-04 20:25 ` [RFC 3/5] ARM: DIGIC: add Canon PowerShot A1100 IS support Antony Pavlov
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Antony Pavlov @ 2013-08-04 20:25 UTC (permalink / raw)
  To: barebox

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/arm/boards/Makefile                |  1 +
 arch/arm/boards/canon-600d/Kconfig      | 10 ++++++++++
 arch/arm/boards/canon-600d/Makefile     |  2 ++
 arch/arm/boards/canon-600d/board.c      | 29 +++++++++++++++++++++++++++++
 arch/arm/boards/canon-600d/env/bin/init | 27 +++++++++++++++++++++++++++
 arch/arm/boards/canon-600d/lowlevel.c   | 10 ++++++++++
 arch/arm/mach-digic/Kconfig             |  5 +++++
 7 files changed, 84 insertions(+)
 create mode 100644 arch/arm/boards/canon-600d/Kconfig
 create mode 100644 arch/arm/boards/canon-600d/Makefile
 create mode 100644 arch/arm/boards/canon-600d/board.c
 create mode 100644 arch/arm/boards/canon-600d/env/bin/init
 create mode 100644 arch/arm/boards/canon-600d/lowlevel.c

diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index 2e924fd..f1160f4 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_MACH_AT91SAM9N12EK)		+= at91sam9n12ek/
 obj-$(CONFIG_MACH_AT91SAM9X5EK)			+= at91sam9x5ek/
 obj-$(CONFIG_MACH_BEAGLE)			+= beagle/
 obj-$(CONFIG_MACH_BEAGLEBONE)			+= beaglebone/
+obj-$(CONFIG_MACH_CANON_600D)			+= canon-600d/
 obj-$(CONFIG_MACH_CCMX51)			+= ccxmx51/
 obj-$(CONFIG_MACH_CFA10036)			+= crystalfontz-cfa10036/
 obj-$(CONFIG_MACH_CHUMBY)			+= chumby_falconwing/
diff --git a/arch/arm/boards/canon-600d/Kconfig b/arch/arm/boards/canon-600d/Kconfig
new file mode 100644
index 0000000..8aebe74
--- /dev/null
+++ b/arch/arm/boards/canon-600d/Kconfig
@@ -0,0 +1,10 @@
+if MACH_CANON_600D
+
+config ARCH_TEXT_BASE
+	hex
+	default 0x00800000
+
+config BOARDINFO
+	default "Canon EOS 600D"
+
+endif
diff --git a/arch/arm/boards/canon-600d/Makefile b/arch/arm/boards/canon-600d/Makefile
new file mode 100644
index 0000000..01c7a25
--- /dev/null
+++ b/arch/arm/boards/canon-600d/Makefile
@@ -0,0 +1,2 @@
+obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/canon-600d/board.c b/arch/arm/boards/canon-600d/board.c
new file mode 100644
index 0000000..9768f91
--- /dev/null
+++ b/arch/arm/boards/canon-600d/board.c
@@ -0,0 +1,29 @@
+/*
+ * 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>
+#include <init.h>
+#include <sizes.h>
+#include <asm/memory.h>
+
+static int mem_init(void)
+{
+	arm_add_mem_device("ram0", 0, SZ_256M);
+
+	return 0;
+}
+mem_initcall(mem_init);
diff --git a/arch/arm/boards/canon-600d/env/bin/init b/arch/arm/boards/canon-600d/env/bin/init
new file mode 100644
index 0000000..99c54ca
--- /dev/null
+++ b/arch/arm/boards/canon-600d/env/bin/init
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# Canon EOS 600D "sd-card activity" led (red)
+LED_ADDR=0xC0220134
+LED_ON=0x46
+LED_OFF=0x44
+
+mw $LED_ADDR $LED_ON
+echo "== /env/bin/init started =="
+echo
+echo "HELLO!"
+mw $LED_ADDR $LED_OFF
+echo
+iomem
+echo
+
+# blink forever
+# use 'echo' for delay
+while true; do
+	echo "led_on"
+	mw $LED_ADDR $LED_ON
+	echo "led_off"
+	mw $LED_ADDR $LED_OFF
+done
+
+#echo
+#echo "== /env/bin/init done =="
diff --git a/arch/arm/boards/canon-600d/lowlevel.c b/arch/arm/boards/canon-600d/lowlevel.c
new file mode 100644
index 0000000..b694c89
--- /dev/null
+++ b/arch/arm/boards/canon-600d/lowlevel.c
@@ -0,0 +1,10 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+void __naked barebox_arm_reset_vector(void)
+{
+	arm_cpu_lowlevel_init();
+	barebox_arm_entry(0x0, SZ_64M, 0);
+}
diff --git a/arch/arm/mach-digic/Kconfig b/arch/arm/mach-digic/Kconfig
index 49ce44a..d1561e8 100644
--- a/arch/arm/mach-digic/Kconfig
+++ b/arch/arm/mach-digic/Kconfig
@@ -3,6 +3,11 @@ if ARCH_DIGIC
 choice
 	prompt "camera type"
 
+config MACH_CANON_600D
+	bool "Canon EOS 600D"
+
 endchoice
 
+source arch/arm/boards/canon-600d/Kconfig
+
 endif
-- 
1.8.3.1


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

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

* [RFC 3/5] ARM: DIGIC: add Canon PowerShot A1100 IS support
  2013-08-04 20:25 [RFC 0/5] JUST-FOR-FUN: run barebox on Canon digital camera Antony Pavlov
  2013-08-04 20:25 ` [RFC 1/5] ARM: add very initial support for Canon DIGIC chips Antony Pavlov
  2013-08-04 20:25 ` [RFC 2/5] ARM: DIGIC: add Canon EOS 600D support Antony Pavlov
@ 2013-08-04 20:25 ` Antony Pavlov
  2013-08-04 20:25 ` [RFC 4/5] ARM: DIGIC: add canon-600d_defconfig Antony Pavlov
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Antony Pavlov @ 2013-08-04 20:25 UTC (permalink / raw)
  To: barebox

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/arm/boards/Makefile                 |  1 +
 arch/arm/boards/canon-a1100/Kconfig      | 10 ++++++++++
 arch/arm/boards/canon-a1100/Makefile     |  2 ++
 arch/arm/boards/canon-a1100/board.c      | 29 +++++++++++++++++++++++++++++
 arch/arm/boards/canon-a1100/env/bin/init | 27 +++++++++++++++++++++++++++
 arch/arm/boards/canon-a1100/lowlevel.c   | 10 ++++++++++
 arch/arm/mach-digic/Kconfig              |  4 ++++
 7 files changed, 83 insertions(+)
 create mode 100644 arch/arm/boards/canon-a1100/Kconfig
 create mode 100644 arch/arm/boards/canon-a1100/Makefile
 create mode 100644 arch/arm/boards/canon-a1100/board.c
 create mode 100644 arch/arm/boards/canon-a1100/env/bin/init
 create mode 100644 arch/arm/boards/canon-a1100/lowlevel.c

diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index f1160f4..1eb120d 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_MACH_AT91SAM9X5EK)			+= at91sam9x5ek/
 obj-$(CONFIG_MACH_BEAGLE)			+= beagle/
 obj-$(CONFIG_MACH_BEAGLEBONE)			+= beaglebone/
 obj-$(CONFIG_MACH_CANON_600D)			+= canon-600d/
+obj-$(CONFIG_MACH_CANON_A1100)			+= canon-a1100/
 obj-$(CONFIG_MACH_CCMX51)			+= ccxmx51/
 obj-$(CONFIG_MACH_CFA10036)			+= crystalfontz-cfa10036/
 obj-$(CONFIG_MACH_CHUMBY)			+= chumby_falconwing/
diff --git a/arch/arm/boards/canon-a1100/Kconfig b/arch/arm/boards/canon-a1100/Kconfig
new file mode 100644
index 0000000..4936336
--- /dev/null
+++ b/arch/arm/boards/canon-a1100/Kconfig
@@ -0,0 +1,10 @@
+if MACH_CANON_A1100
+
+config ARCH_TEXT_BASE
+	hex
+	default 0x00001900
+
+config BOARDINFO
+	default "Canon PowerShot A1100 IS"
+
+endif
diff --git a/arch/arm/boards/canon-a1100/Makefile b/arch/arm/boards/canon-a1100/Makefile
new file mode 100644
index 0000000..01c7a25
--- /dev/null
+++ b/arch/arm/boards/canon-a1100/Makefile
@@ -0,0 +1,2 @@
+obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/canon-a1100/board.c b/arch/arm/boards/canon-a1100/board.c
new file mode 100644
index 0000000..e508399
--- /dev/null
+++ b/arch/arm/boards/canon-a1100/board.c
@@ -0,0 +1,29 @@
+/*
+ * 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>
+#include <init.h>
+#include <sizes.h>
+#include <asm/memory.h>
+
+static int mem_init(void)
+{
+	arm_add_mem_device("ram0", 0, SZ_8M);
+
+	return 0;
+}
+mem_initcall(mem_init);
diff --git a/arch/arm/boards/canon-a1100/env/bin/init b/arch/arm/boards/canon-a1100/env/bin/init
new file mode 100644
index 0000000..d9173b2
--- /dev/null
+++ b/arch/arm/boards/canon-a1100/env/bin/init
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# Canon PowerShot A1100 IS "direct print" led (blue)
+LED_ADDR=0xC02200CC
+LED_ON=0x46
+LED_OFF=0x44
+
+mw $LED_ADDR $LED_ON
+echo "== /env/bin/init started =="
+echo
+echo "HELLO!"
+mw $LED_ADDR $LED_OFF
+echo
+iomem
+echo
+
+# blink forever
+# use 'echo' for delay
+while true; do
+	echo "led_on"
+	mw $LED_ADDR $LED_ON
+	echo "led_off"
+	mw $LED_ADDR $LED_OFF
+done
+
+#echo
+#echo "== /env/bin/init done =="
diff --git a/arch/arm/boards/canon-a1100/lowlevel.c b/arch/arm/boards/canon-a1100/lowlevel.c
new file mode 100644
index 0000000..aed34e0
--- /dev/null
+++ b/arch/arm/boards/canon-a1100/lowlevel.c
@@ -0,0 +1,10 @@
+#include <common.h>
+#include <sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+void __naked barebox_arm_reset_vector(void)
+{
+	arm_cpu_lowlevel_init();
+	barebox_arm_entry(0x0, SZ_8M, 0);
+}
diff --git a/arch/arm/mach-digic/Kconfig b/arch/arm/mach-digic/Kconfig
index d1561e8..7354540 100644
--- a/arch/arm/mach-digic/Kconfig
+++ b/arch/arm/mach-digic/Kconfig
@@ -6,8 +6,12 @@ choice
 config MACH_CANON_600D
 	bool "Canon EOS 600D"
 
+config MACH_CANON_A1100
+	bool "Canon PowerShot A1100 IS"
+
 endchoice
 
 source arch/arm/boards/canon-600d/Kconfig
+source arch/arm/boards/canon-a1100/Kconfig
 
 endif
-- 
1.8.3.1


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

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

* [RFC 4/5] ARM: DIGIC: add canon-600d_defconfig
  2013-08-04 20:25 [RFC 0/5] JUST-FOR-FUN: run barebox on Canon digital camera Antony Pavlov
                   ` (2 preceding siblings ...)
  2013-08-04 20:25 ` [RFC 3/5] ARM: DIGIC: add Canon PowerShot A1100 IS support Antony Pavlov
@ 2013-08-04 20:25 ` 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
  5 siblings, 0 replies; 8+ messages in thread
From: Antony Pavlov @ 2013-08-04 20:25 UTC (permalink / raw)
  To: barebox

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/arm/configs/canon-600d_defconfig | 40 +++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 arch/arm/configs/canon-600d_defconfig

diff --git a/arch/arm/configs/canon-600d_defconfig b/arch/arm/configs/canon-600d_defconfig
new file mode 100644
index 0000000..862abf2
--- /dev/null
+++ b/arch/arm/configs/canon-600d_defconfig
@@ -0,0 +1,40 @@
+CONFIG_ARCH_DIGIC=y
+CONFIG_MACH_CANON_600D=y
+CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
+CONFIG_PBL_IMAGE=y
+CONFIG_PBL_RELOCATABLE=y
+CONFIG_IMAGE_COMPRESSION_LZ4=y
+CONFIG_TEXT_BASE=0x00300000
+CONFIG_MALLOC_SIZE=0x200000
+CONFIG_PANIC_HANG=y
+CONFIG_PROMPT="canon> "
+CONFIG_LONGHELP=y
+CONFIG_GLOB=y
+CONFIG_HUSH_FANCY_PROMPT=y
+CONFIG_HUSH_GETOPT=y
+CONFIG_CMDLINE_EDITING=y
+CONFIG_AUTO_COMPLETE=y
+CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/canon-600d/env"
+CONFIG_DEBUG_LL=y
+CONFIG_CMD_SLEEP=y
+CONFIG_CMD_GLOBAL=y
+# CONFIG_CMD_RM is not set
+# CONFIG_CMD_MKDIR is not set
+# CONFIG_CMD_RMDIR is not set
+# CONFIG_CMD_PWD is not set
+# CONFIG_CMD_MOUNT is not set
+# CONFIG_CMD_UMOUNT is not set
+# CONFIG_CMD_CLEAR is not set
+CONFIG_CMD_ECHO_E=y
+CONFIG_CMD_IOMEM=y
+# CONFIG_CMD_MEMCMP is not set
+# CONFIG_CMD_MEMCPY is not set
+# CONFIG_CMD_MEMSET is not set
+# CONFIG_CMD_BOOTM is not set
+# CONFIG_CMD_BOOTU is not set
+# CONFIG_CMD_TEST is not set
+# CONFIG_CMD_VERSION is not set
+# CONFIG_CMD_HELP is not set
+# CONFIG_CMD_DEVINFO is not set
+# CONFIG_SPI is not set
+CONFIG_ZLIB=y
-- 
1.8.3.1


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

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

* [RFC 5/5] ARM: DIGIC: add canon-a1100_defconfig
  2013-08-04 20:25 [RFC 0/5] JUST-FOR-FUN: run barebox on Canon digital camera Antony Pavlov
                   ` (3 preceding siblings ...)
  2013-08-04 20:25 ` [RFC 4/5] ARM: DIGIC: add canon-600d_defconfig Antony Pavlov
@ 2013-08-04 20:25 ` Antony Pavlov
  2013-08-06  7:13 ` [RFC 0/5] JUST-FOR-FUN: run barebox on Canon digital camera Sascha Hauer
  5 siblings, 0 replies; 8+ messages in thread
From: Antony Pavlov @ 2013-08-04 20:25 UTC (permalink / raw)
  To: barebox

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/arm/configs/canon-a1100_defconfig | 40 ++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 arch/arm/configs/canon-a1100_defconfig

diff --git a/arch/arm/configs/canon-a1100_defconfig b/arch/arm/configs/canon-a1100_defconfig
new file mode 100644
index 0000000..6fad0c6
--- /dev/null
+++ b/arch/arm/configs/canon-a1100_defconfig
@@ -0,0 +1,40 @@
+CONFIG_ARCH_DIGIC=y
+CONFIG_MACH_CANON_A1100=y
+CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
+CONFIG_PBL_IMAGE=y
+CONFIG_PBL_RELOCATABLE=y
+CONFIG_IMAGE_COMPRESSION_LZ4=y
+CONFIG_TEXT_BASE=0x00300000
+CONFIG_MALLOC_SIZE=0x200000
+CONFIG_PANIC_HANG=y
+CONFIG_PROMPT="canon> "
+CONFIG_LONGHELP=y
+CONFIG_GLOB=y
+CONFIG_HUSH_FANCY_PROMPT=y
+CONFIG_HUSH_GETOPT=y
+CONFIG_CMDLINE_EDITING=y
+CONFIG_AUTO_COMPLETE=y
+CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/canon-a1100/env"
+CONFIG_DEBUG_LL=y
+CONFIG_CMD_SLEEP=y
+CONFIG_CMD_GLOBAL=y
+# CONFIG_CMD_RM is not set
+# CONFIG_CMD_MKDIR is not set
+# CONFIG_CMD_RMDIR is not set
+# CONFIG_CMD_PWD is not set
+# CONFIG_CMD_MOUNT is not set
+# CONFIG_CMD_UMOUNT is not set
+# CONFIG_CMD_CLEAR is not set
+CONFIG_CMD_ECHO_E=y
+CONFIG_CMD_IOMEM=y
+# CONFIG_CMD_MEMCMP is not set
+# CONFIG_CMD_MEMCPY is not set
+# CONFIG_CMD_MEMSET is not set
+# CONFIG_CMD_BOOTM is not set
+# CONFIG_CMD_BOOTU is not set
+# CONFIG_CMD_TEST is not set
+# CONFIG_CMD_VERSION is not set
+# CONFIG_CMD_HELP is not set
+# CONFIG_CMD_DEVINFO is not set
+# CONFIG_SPI is not set
+CONFIG_ZLIB=y
-- 
1.8.3.1


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

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

* Re: [RFC 0/5] JUST-FOR-FUN: run barebox on Canon digital camera
  2013-08-04 20:25 [RFC 0/5] JUST-FOR-FUN: run barebox on Canon digital camera Antony Pavlov
                   ` (4 preceding siblings ...)
  2013-08-04 20:25 ` [RFC 5/5] ARM: DIGIC: add canon-a1100_defconfig Antony Pavlov
@ 2013-08-06  7:13 ` Sascha Hauer
  2013-08-06  9:42   ` Antony Pavlov
  5 siblings, 1 reply; 8+ messages in thread
From: Sascha Hauer @ 2013-08-06  7:13 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Mon, Aug 05, 2013 at 12:25:22AM +0400, Antony Pavlov wrote:
> Please don't commit the patches!
> 
> This patch series introduce minimal support
> for Canon DIGIC4-based cameras.
> 
> Supported cameras:
> 
>  * Canon PowerShot A1100;
>  * Canon EOS 600D;
>  * Canon EOS Magic Lantern qemu-based emulator.
> 
> After booting barebox starts compiled-in script
> that use 'mw' command to blink camera's LED.
> 
> Just now barebox for Canon cameras is a demo
> but after some improvements it can become very
> handy tool for CHDK and Magic Lantern development.

Very cool stuff.

I'll have to have a look what model my wifes camera is ;)

I'd be amazed if barebox could be used to help the magic lantern
project.

Sascha

-- 
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] 8+ messages in thread

* Re: [RFC 0/5] JUST-FOR-FUN: run barebox on Canon digital camera
  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
  0 siblings, 0 replies; 8+ messages in thread
From: Antony Pavlov @ 2013-08-06  9:42 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On Tue, 6 Aug 2013 09:13:53 +0200
Sascha Hauer <s.hauer@pengutronix.de> wrote:

> On Mon, Aug 05, 2013 at 12:25:22AM +0400, Antony Pavlov wrote:
> > Please don't commit the patches!
> > 
> > This patch series introduce minimal support
> > for Canon DIGIC4-based cameras.
> > 
> > Supported cameras:
> > 
> >  * Canon PowerShot A1100;
> >  * Canon EOS 600D;
> >  * Canon EOS Magic Lantern qemu-based emulator.
> > 
> > After booting barebox starts compiled-in script
> > that use 'mw' command to blink camera's LED.
> > 
> > Just now barebox for Canon cameras is a demo
> > but after some improvements it can become very
> > handy tool for CHDK and Magic Lantern development.
> 
> Very cool stuff.
> 
> I'll have to have a look what model my wifes camera is ;)

To tell the truth there is no big difference in Canon cameras
for barebox developer. You can see, that there are no differences
in a1100 and 600d code in barebox (just memory size, but it can
be moved into device tree file). Moreover AFAIR there are no significant
software model differences between the chips in the DIGIC family.

To blink the LED of your PowerShot camera you only need to know 
the led-related GPIO address and canon binary file encode algorithm.
Both of this things can be obtained in the CHDK sources.

For DSRL cameras the situation is even less difficult.

> I'd be amazed if barebox could be used to help the magic lantern
> project.

If you want to help the Magic Lantern project please briefly describe
your mode of operation with incoming patches. AFAIR you have some
scripts to check all boards build after every single commit.
The Magic Lantern developers have some problems as they use
very different mode of operation:
 1. commit the change to the repo;
 2. fix build or functional error some time later.

I have adapted MAKEALL script from barebox for Magic Lantern,
but I have not not yet finished the script to check every new
mercurial commit (as Magic Lantern developers use mercurial).

-- 
Best regards,
  Antony Pavlov

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

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

end of thread, other threads:[~2013-08-06  9:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-04 20:25 [RFC 0/5] JUST-FOR-FUN: run barebox on Canon digital camera Antony Pavlov
2013-08-04 20:25 ` [RFC 1/5] ARM: add very initial support for Canon DIGIC chips Antony Pavlov
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

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